!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a('
'+c+"
"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay() },this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("
").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document); (function(e){e.extend(e.fn,{validate:function(t){if(!this.length){t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.");return}var n=e.data(this[0],"validator");return n?n:(this.attr("novalidate","novalidate"),n=new e.validator(t,this[0]),e.data(this[0],"validator",n),n.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){n.settings.submitHandler&&(n.submitButton=t.target),e(t.target).hasClass("cancel")&&(n.cancelSubmit=!0)}),this.submit(function(t){function r(){var r;return n.settings.submitHandler?(n.submitButton&&(r=e("").attr("name",n.submitButton.name).val(n.submitButton.value).appendTo(n.currentForm)),n.settings.submitHandler.call(n,n.currentForm,t),n.submitButton&&r.remove(),!1):!0}return n.settings.debug&&t.preventDefault(),n.cancelSubmit?(n.cancelSubmit=!1,r()):n.form()?n.pendingRequest?(n.formSubmitted=!0,!1):r():(n.focusInvalid(),!1)})),n)},valid:function(){if(e(this[0]).is("form"))return this.validate().form();var t=!0,n=e(this[0].form).validate();return this.each(function(){t&=n.element(this)}),t},removeAttrs:function(t){var n={},r=this;return e.each(t.split(/\s/),function(e,t){n[t]=r.attr(t),r.removeAttr(t)}),n},rules:function(t,n){var r=this[0];if(t){var i=e.data(r.form,"validator").settings,s=i.rules,o=e.validator.staticRules(r);switch(t){case"add":e.extend(o,e.validator.normalizeRule(n)),s[r.name]=o,n.messages&&(i.messages[r.name]=e.extend(i.messages[r.name],n.messages));break;case"remove":if(!n)return delete s[r.name],o;var u={};return e.each(n.split(/\s/),function(e,t){u[t]=o[t],delete o[t]}),u}}var a=e.validator.normalizeRules(e.extend({},e.validator.classRules(r),e.validator.attributeRules(r),e.validator.dataRules(r),e.validator.staticRules(r)),r);if(a.required){var f=a.required;delete a.required,a=e.extend({required:f},a)}return a}}),e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+t.value)},filled:function(t){return!!e.trim(""+t.value)},unchecked:function(e){return!e.checked}}),e.validator=function(t,n){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=n,this.init()},e.validator.format=function(t,n){return arguments.length===1?function(){var n=e.makeArray(arguments);return n.unshift(t),e.validator.format.apply(this,n)}:(arguments.length>2&&n.constructor!==Array&&(n=e.makeArray(arguments).slice(1)),n.constructor!==Array&&(n=[n]),e.each(n,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e,t){this.lastActive=e,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(e)).hide())},onfocusout:function(e,t){!this.checkable(e)&&(e.name in this.submitted||!this.optional(e))&&this.element(e)},onkeyup:function(e,t){if(t.which===9&&this.elementValue(e)==="")return;(e.name in this.submitted||e===this.lastElement)&&this.element(e)},onclick:function(e,t){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).addClass(n).removeClass(r):e(t).addClass(n).removeClass(r)},unhighlight:function(t,n,r){t.type==="radio"?this.findByName(t.name).removeClass(n).addClass(r):e(t).removeClass(n).addClass(r)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function r(t){var n=e.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");n.settings[r]&&n.settings[r].call(n,this[0],t)}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var t=this.groups={};e.each(this.settings.groups,function(n,r){typeof r=="string"&&(r=r.split(/\s/)),e.each(r,function(e,r){t[r]=n})});var n=this.settings.rules;e.each(n,function(t,r){n[t]=e.validator.normalizeRule(r)}),e(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",r).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",r),this.settings.invalidHandler&&e(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t)),this.lastElement=t,this.prepareElement(t),this.currentElements=e(t);var n=this.check(t)!==!1;return n?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),n},showErrors:function(t){if(t){e.extend(this.errorMap,t),this.errorList=[];for(var n in t)this.errorList.push({message:t[n],element:this.findByName(n)[0]});this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t=0;for(var n in e)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&e.grep(this.errorList,function(e){return e.element.name===t.name}).length===1&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in n||!t.objectLength(e(this).rules())?!1:(n[this.name]=!0,!0)})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([]),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var n=e(t).attr("type"),r=e(t).val();return n==="radio"||n==="checkbox"?e("input[name='"+e(t).attr("name")+"']:checked").val():typeof r=="string"?r.replace(/\r/g,""):r},check:function(t){t=this.validationTargetFor(this.clean(t));var n=e(t).rules(),r=!1,i=this.elementValue(t),s;for(var o in n){var u={method:o,parameters:n[o]};try{s=e.validator.methods[o].call(this,i,t,u.parameters);if(s==="dependency-mismatch"){r=!0;continue}r=!1;if(s==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!s)return this.formatAndAdd(t,u),!1}catch(a){throw this.settings.debug&&window.console&&console.log("Exception occured when checking element "+t.id+", check the '"+u.method+"' method.",a),a}}if(r)return;return this.objectLength(n)&&this.successList.push(t),!0},customDataMessage:function(t,n){return e(t).data("msg-"+n.toLowerCase())||t.attributes&&e(t).attr("data-msg-"+n.toLowerCase())},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;eWarning: No message defined for "+t.name+"")},formatAndAdd:function(t,n){var r=this.defaultMessage(t,n.method),i=/\$?\{(\d+)\}/g;typeof r=="function"?r=r.call(this,n.parameters,t):i.test(r)&&(r=e.validator.format(r.replace(i,"{$1}"),n.parameters)),this.errorList.push({message:r,element:t}),this.errorMap[t.name]=r,this.submitted[t.name]=r},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t;for(e=0;this.errorList[e];e++){var n=this.errorList[e];this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message)}this.errorList.length&&(this.toShow=this.toShow.add(this.containers));if(this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(n)):(r=e("<"+this.settings.errorElement+">").attr("for",this.idOrName(t)).addClass(this.settings.errorClass).html(n||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,e(t)):r.insertAfter(t))),!n&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r,t)),this.toShow=this.toShow.add(r)},errorsFor:function(t){var n=this.idOrName(t);return this.errors().filter(function(){return e(this).attr("for")===n})},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name).not(this.settings.ignore)[0]),e},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+t+"']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n))return this.findByName(n.name).filter(":checked").length}return t.length},depend:function(e,t){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,t):!0},dependTypes:{"boolean":function(e,t){return e},string:function(t,n){return!!e(t,n.form).length},"function":function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(t,n){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],n&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(e(this.currentForm).submit(),this.formSubmitted=!1):!n&&this.pendingRequest===0&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,n){t.constructor===String?this.classRuleSettings[t]=n:e.extend(this.classRuleSettings,t)},classRules:function(t){var n={},r=e(t).attr("class");return r&&e.each(r.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(n,e.validator.classRuleSettings[this])}),n},attributeRules:function(t){var n={},r=e(t);for(var i in e.validator.methods){var s;i==="required"?(s=r.get(0).getAttribute(i),s===""&&(s=!0),s=!!s):s=r.attr(i),s?n[i]=s:r[0].getAttribute("type")===i&&(n[i]=!0)}return n.maxlength&&/-1|2147483647|524288/.test(n.maxlength)&&delete n.maxlength,n},dataRules:function(t){var n,r,i={},s=e(t);for(n in e.validator.methods)r=s.data("rule-"+n.toLowerCase()),r!==undefined&&(i[n]=r);return i},staticRules:function(t){var n={},r=e.data(t.form,"validator");return r.settings.rules&&(n=e.validator.normalizeRule(r.settings.rules[t.name])||{}),n},normalizeRules:function(t,n){return e.each(t,function(r,i){if(i===!1){delete t[r];return}if(i.param||i.depends){var s=!0;switch(typeof i.depends){case"string":s=!!e(i.depends,n.form).length;break;case"function":s=i.depends.call(n,n)}s?t[r]=i.param!==undefined?i.param:!0:delete t[r]}}),e.each(t,function(r,i){t[r]=e.isFunction(i)?i(n):i}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength"],function(){var n;t[this]&&(e.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:typeof t[this]=="string"&&(n=t[this].split(/[\s,]+/),t[this]=[Number(n[0]),Number(n[1])]))}),e.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if(typeof t=="string"){var n={};e.each(t.split(/\s/),function(){n[this]=!0}),t=n}return t},addMethod:function(t,n,r){e.validator.methods[t]=n,e.validator.messages[t]=r!==undefined?r:e.validator.messages[t],n.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,n,r){if(!this.depend(r,n))return"dependency-mismatch";if(n.nodeName.toLowerCase()==="select"){var i=e(n).val();return i&&i.length>0}return this.checkable(n)?this.getLength(t,n)>0:e.trim(t).length>0},remote:function(t,n,r){if(this.optional(n))return"dependency-mismatch";var i=this.previousValue(n);this.settings.messages[n.name]||(this.settings.messages[n.name]={}),i.originalMessage=this.settings.messages[n.name].remote,this.settings.messages[n.name].remote=i.message,r=typeof r=="string"&&{url:r}||r;if(i.old===t)return i.valid;i.old=t;var s=this;this.startRequest(n);var o={};return o[n.name]=t,e.ajax(e.extend(!0,{url:r,mode:"abort",port:"validate"+n.name,dataType:"json",data:o,success:function(r){s.settings.messages[n.name].remote=i.originalMessage;var o=r===!0||r==="true";if(o){var u=s.formSubmitted;s.prepareElement(n),s.formSubmitted=u,s.successList.push(n),delete s.invalid[n.name],s.showErrors()}else{var a={},f=r||s.defaultMessage(n,"remote");a[n.name]=i.message=e.isFunction(f)?f(t):f,s.invalid[n.name]=!0,s.showErrors(a)}i.valid=o,s.stopRequest(n,o)}},r)),"pending"},minlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r},maxlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i<=r},rangelength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r[0]&&i<=r[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},email:function(e,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test((new Date(e)).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var n=0,r=0,i=!1;e=e.replace(/\D/g,"");for(var s=e.length-1;s>=0;s--){var o=e.charAt(s);r=parseInt(o,10),i&&(r*=2)>9&&(r-=9),n+=r,i=!i}return n%10===0},equalTo:function(t,n,r){var i=e(r);return this.settings.onfocusout&&i.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){e(n).valid()}),t===i.val()}}}),e.format=e.validator.format})(jQuery),function(e){var t={};if(e.ajaxPrefilter)e.ajaxPrefilter(function(e,n,r){var i=e.port;e.mode==="abort"&&(t[i]&&t[i].abort(),t[i]=r)});else{var n=e.ajax;e.ajax=function(r){var i=("mode"in r?r:e.ajaxSettings).mode,s=("port"in r?r:e.ajaxSettings).port;return i==="abort"?(t[s]&&t[s].abort(),t[s]=n.apply(this,arguments)):n.apply(this,arguments)}}}(jQuery),function(e){e.extend(e.fn,{validateDelegate:function(t,n,r){return this.bind(n,function(n){var i=e(n.target);if(i.is(t))return r.apply(i,arguments)})}})}(jQuery); jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g=0)&&focusable(element, !isTabIndexNaN); }}); if(!$("").outerWidth(1).jquery){ $.each([ "Width", "Height" ], function(i, name){ var side=name==="Width" ? [ "Left", "Right" ]:[ "Top", "Bottom" ], type=name.toLowerCase(), orig={ innerWidth: $.fn.innerWidth, innerHeight: $.fn.innerHeight, outerWidth: $.fn.outerWidth, outerHeight: $.fn.outerHeight }; function reduce(elem, size, border, margin){ $.each(side, function(){ size -=parseFloat($.css(elem, "padding" + this))||0; if(border){ size -=parseFloat($.css(elem, "border" + this + "Width"))||0; } if(margin){ size -=parseFloat($.css(elem, "margin" + this))||0; }}); return size; } $.fn[ "inner" + name ]=function(size){ if(size===undefined){ return orig[ "inner" + name ].call(this); } return this.each(function(){ $(this).css(type, reduce(this, size) + "px"); }); }; $.fn[ "outer" + name]=function(size, margin){ if(typeof size!=="number"){ return orig[ "outer" + name ].call(this, size); } return this.each(function(){ $(this).css(type, reduce(this, size, true, margin) + "px"); }); };}); } if(!$.fn.addBack){ $.fn.addBack=function(selector){ return this.add(selector==null ? this.prevObject:this.prevObject.filter(selector) ); };} if($("").data("a-b", "a").removeData("a-b").data("a-b")){ $.fn.removeData=(function(removeData){ return function(key){ if(arguments.length){ return removeData.call(this, $.camelCase(key)); }else{ return removeData.call(this); }};})($.fn.removeData); } $.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); $.fn.extend({ focus: (function(orig){ return function(delay, fn){ return typeof delay==="number" ? this.each(function(){ var elem=this; setTimeout(function(){ $(elem).focus(); if(fn){ fn.call(elem); }}, delay); }) : orig.apply(this, arguments); };})($.fn.focus), disableSelection: (function(){ var eventType="onselectstart" in document.createElement("div") ? "selectstart" : "mousedown"; return function(){ return this.bind(eventType + ".ui-disableSelection", function(event){ event.preventDefault(); }); };})(), enableSelection: function(){ return this.unbind(".ui-disableSelection"); }, zIndex: function(zIndex){ if(zIndex!==undefined){ return this.css("zIndex", zIndex); } if(this.length){ var elem=$(this[ 0 ]), position, value; while(elem.length&&elem[ 0 ]!==document){ position=elem.css("position"); if(position==="absolute"||position==="relative"||position==="fixed"){ value=parseInt(elem.css("zIndex"), 10); if(!isNaN(value)&&value!==0){ return value; }} elem=elem.parent(); }} return 0; }}); $.ui.plugin={ add: function(module, option, set){ var i, proto=$.ui[ module ].prototype; for(i in set){ proto.plugins[ i ]=proto.plugins[ i ]||[]; proto.plugins[ i ].push([ option, set[ i ] ]); }}, call: function(instance, name, args, allowDisconnected){ var i, set=instance.plugins[ name ]; if(!set){ return; } if(!allowDisconnected&&(!instance.element[ 0 ].parentNode||instance.element[ 0 ].parentNode.nodeType===11)){ return; } for(i=0; i < set.length; i++){ if(instance.options[ set[ i ][ 0 ] ]){ set[ i ][ 1 ].apply(instance.element, args); }} }}; var widget_uuid=0, widget_slice=Array.prototype.slice; $.cleanData=(function(orig){ return function(elems){ var events, elem, i; for(i=0; (elem=elems[i])!=null; i++){ try { events=$._data(elem, "events"); if(events&&events.remove){ $(elem).triggerHandler("remove"); }} catch(e){}} orig(elems); };})($.cleanData); $.widget=function(name, base, prototype){ var fullName, existingConstructor, constructor, basePrototype, proxiedPrototype={}, namespace=name.split(".")[ 0 ]; name=name.split(".")[ 1 ]; fullName=namespace + "-" + name; if(!prototype){ prototype=base; base=$.Widget; } $.expr[ ":" ][ fullName.toLowerCase() ]=function(elem){ return !!$.data(elem, fullName); }; $[ namespace ]=$[ namespace ]||{}; existingConstructor=$[ namespace ][ name ]; constructor=$[ namespace ][ name ]=function(options, element){ if(!this._createWidget){ return new constructor(options, element); } if(arguments.length){ this._createWidget(options, element); }}; $.extend(constructor, existingConstructor, { version: prototype.version, _proto: $.extend({}, prototype), _childConstructors: [] }); basePrototype=new base(); basePrototype.options=$.widget.extend({}, basePrototype.options); $.each(prototype, function(prop, value){ if(!$.isFunction(value)){ proxiedPrototype[ prop ]=value; return; } proxiedPrototype[ prop ]=(function(){ var _super=function(){ return base.prototype[ prop ].apply(this, arguments); }, _superApply=function(args){ return base.prototype[ prop ].apply(this, args); }; return function(){ var __super=this._super, __superApply=this._superApply, returnValue; this._super=_super; this._superApply=_superApply; returnValue=value.apply(this, arguments); this._super=__super; this._superApply=__superApply; return returnValue; };})(); }); constructor.prototype=$.widget.extend(basePrototype, { widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix||name):name }, proxiedPrototype, { constructor: constructor, namespace: namespace, widgetName: name, widgetFullName: fullName }); if(existingConstructor){ $.each(existingConstructor._childConstructors, function(i, child){ var childPrototype=child.prototype; $.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto); }); delete existingConstructor._childConstructors; }else{ base._childConstructors.push(constructor); } $.widget.bridge(name, constructor); return constructor; }; $.widget.extend=function(target){ var input=widget_slice.call(arguments, 1), inputIndex=0, inputLength=input.length, key, value; for(; inputIndex < inputLength; inputIndex++){ for(key in input[ inputIndex ]){ value=input[ inputIndex ][ key ]; if(input[ inputIndex ].hasOwnProperty(key)&&value!==undefined){ if($.isPlainObject(value)){ target[ key ]=$.isPlainObject(target[ key ]) ? $.widget.extend({}, target[ key ], value) : $.widget.extend({}, value); }else{ target[ key ]=value; }} }} return target; }; $.widget.bridge=function(name, object){ var fullName=object.prototype.widgetFullName||name; $.fn[ name ]=function(options){ var isMethodCall=typeof options==="string", args=widget_slice.call(arguments, 1), returnValue=this; if(isMethodCall){ this.each(function(){ var methodValue, instance=$.data(this, fullName); if(options==="instance"){ returnValue=instance; return false; } if(!instance){ return $.error("cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'"); } if(!$.isFunction(instance[options])||options.charAt(0)==="_"){ return $.error("no such method '" + options + "' for " + name + " widget instance"); } methodValue=instance[ options ].apply(instance, args); if(methodValue!==instance&&methodValue!==undefined){ returnValue=methodValue&&methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue; return false; }}); }else{ if(args.length){ options=$.widget.extend.apply(null, [ options ].concat(args)); } this.each(function(){ var instance=$.data(this, fullName); if(instance){ instance.option(options||{}); if(instance._init){ instance._init(); }}else{ $.data(this, fullName, new object(options, this)); }}); } return returnValue; };}; $.Widget=function(){}; $.Widget._childConstructors=[]; $.Widget.prototype={ widgetName: "widget", widgetEventPrefix: "", defaultElement: "
", options: { disabled: false, create: null }, _createWidget: function(options, element){ element=$(element||this.defaultElement||this)[ 0 ]; this.element=$(element); this.uuid=widget_uuid++; this.eventNamespace="." + this.widgetName + this.uuid; this.bindings=$(); this.hoverable=$(); this.focusable=$(); if(element!==this){ $.data(element, this.widgetFullName, this); this._on(true, this.element, { remove: function(event){ if(event.target===element){ this.destroy(); }} }); this.document=$(element.style ? element.ownerDocument : element.document||element); this.window=$(this.document[0].defaultView||this.document[0].parentWindow); } this.options=$.widget.extend({}, this.options, this._getCreateOptions(), options); this._create(); this._trigger("create", null, this._getCreateEventData()); this._init(); }, _getCreateOptions: $.noop, _getCreateEventData: $.noop, _create: $.noop, _init: $.noop, destroy: function(){ this._destroy(); this.element .unbind(this.eventNamespace) .removeData(this.widgetFullName) .removeData($.camelCase(this.widgetFullName)); this.widget() .unbind(this.eventNamespace) .removeAttr("aria-disabled") .removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"); this.bindings.unbind(this.eventNamespace); this.hoverable.removeClass("ui-state-hover"); this.focusable.removeClass("ui-state-focus"); }, _destroy: $.noop, widget: function(){ return this.element; }, option: function(key, value){ var options=key, parts, curOption, i; if(arguments.length===0){ return $.widget.extend({}, this.options); } if(typeof key==="string"){ options={}; parts=key.split("."); key=parts.shift(); if(parts.length){ curOption=options[ key ]=$.widget.extend({}, this.options[ key ]); for(i=0; i < parts.length - 1; i++){ curOption[ parts[ i ] ]=curOption[ parts[ i ] ]||{}; curOption=curOption[ parts[ i ] ]; } key=parts.pop(); if(arguments.length===1){ return curOption[ key ]===undefined ? null:curOption[ key ]; } curOption[ key ]=value; }else{ if(arguments.length===1){ return this.options[ key ]===undefined ? null:this.options[ key ]; } options[ key ]=value; }} this._setOptions(options); return this; }, _setOptions: function(options){ var key; for(key in options){ this._setOption(key, options[ key ]); } return this; }, _setOption: function(key, value){ this.options[ key ]=value; if(key==="disabled"){ this.widget() .toggleClass(this.widgetFullName + "-disabled", !!value); if(value){ this.hoverable.removeClass("ui-state-hover"); this.focusable.removeClass("ui-state-focus"); }} return this; }, enable: function(){ return this._setOptions({ disabled: false }); }, disable: function(){ return this._setOptions({ disabled: true }); }, _on: function(suppressDisabledCheck, element, handlers){ var delegateElement, instance=this; if(typeof suppressDisabledCheck!=="boolean"){ handlers=element; element=suppressDisabledCheck; suppressDisabledCheck=false; } if(!handlers){ handlers=element; element=this.element; delegateElement=this.widget(); }else{ element=delegateElement=$(element); this.bindings=this.bindings.add(element); } $.each(handlers, function(event, handler){ function handlerProxy(){ if(!suppressDisabledCheck && (instance.options.disabled===true || $(this).hasClass("ui-state-disabled"))){ return; } return(typeof handler==="string" ? instance[ handler ]:handler) .apply(instance, arguments); } if(typeof handler!=="string"){ handlerProxy.guid=handler.guid = handler.guid||handlerProxy.guid||$.guid++; } var match=event.match(/^([\w:-]*)\s*(.*)$/), eventName=match[1] + instance.eventNamespace, selector=match[2]; if(selector){ delegateElement.delegate(selector, eventName, handlerProxy); }else{ element.bind(eventName, handlerProxy); }}); }, _off: function(element, eventName){ eventName=(eventName||"").split(" ").join(this.eventNamespace + " ") + this.eventNamespace; element.unbind(eventName).undelegate(eventName); this.bindings=$(this.bindings.not(element).get()); this.focusable=$(this.focusable.not(element).get()); this.hoverable=$(this.hoverable.not(element).get()); }, _delay: function(handler, delay){ function handlerProxy(){ return(typeof handler==="string" ? instance[ handler ]:handler) .apply(instance, arguments); } var instance=this; return setTimeout(handlerProxy, delay||0); }, _hoverable: function(element){ this.hoverable=this.hoverable.add(element); this._on(element, { mouseenter: function(event){ $(event.currentTarget).addClass("ui-state-hover"); }, mouseleave: function(event){ $(event.currentTarget).removeClass("ui-state-hover"); }}); }, _focusable: function(element){ this.focusable=this.focusable.add(element); this._on(element, { focusin: function(event){ $(event.currentTarget).addClass("ui-state-focus"); }, focusout: function(event){ $(event.currentTarget).removeClass("ui-state-focus"); }}); }, _trigger: function(type, event, data){ var prop, orig, callback=this.options[ type ]; data=data||{}; event=$.Event(event); event.type=(type===this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase(); event.target=this.element[ 0 ]; orig=event.originalEvent; if(orig){ for(prop in orig){ if(!(prop in event)){ event[ prop ]=orig[ prop ]; }} } this.element.trigger(event, data); return !($.isFunction(callback) && callback.apply(this.element[0], [ event ].concat(data))===false || event.isDefaultPrevented()); }}; $.each({ show: "fadeIn", hide: "fadeOut" }, function(method, defaultEffect){ $.Widget.prototype[ "_" + method ]=function(element, options, callback){ if(typeof options==="string"){ options={ effect: options };} var hasOptions, effectName = !options ? method : options===true||typeof options==="number" ? defaultEffect : options.effect||defaultEffect; options=options||{}; if(typeof options==="number"){ options={ duration: options };} hasOptions = !$.isEmptyObject(options); options.complete=callback; if(options.delay){ element.delay(options.delay); } if(hasOptions&&$.effects&&$.effects.effect[ effectName ]){ element[ method ](options); }else if(effectName!==method&&element[ effectName ]){ element[ effectName ](options.duration, options.easing, callback); }else{ element.queue(function(next){ $(this)[ method ](); if(callback){ callback.call(element[ 0 ]); } next(); }); }};}); var widget=$.widget; var mouseHandled=false; $(document).mouseup(function(){ mouseHandled=false; }); var mouse=$.widget("ui.mouse", { version: "1.11.4", options: { cancel: "input,textarea,button,select,option", distance: 1, delay: 0 }, _mouseInit: function(){ var that=this; this.element .bind("mousedown." + this.widgetName, function(event){ return that._mouseDown(event); }) .bind("click." + this.widgetName, function(event){ if(true===$.data(event.target, that.widgetName + ".preventClickEvent")){ $.removeData(event.target, that.widgetName + ".preventClickEvent"); event.stopImmediatePropagation(); return false; }}); this.started=false; }, _mouseDestroy: function(){ this.element.unbind("." + this.widgetName); if(this._mouseMoveDelegate){ this.document .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); }}, _mouseDown: function(event){ if(mouseHandled){ return; } this._mouseMoved=false; (this._mouseStarted&&this._mouseUp(event)); this._mouseDownEvent=event; var that=this, btnIsLeft=(event.which===1), elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName ? $(event.target).closest(this.options.cancel).length:false); if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){ return true; } this.mouseDelayMet = !this.options.delay; if(!this.mouseDelayMet){ this._mouseDelayTimer=setTimeout(function(){ that.mouseDelayMet=true; }, this.options.delay); } if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){ this._mouseStarted=(this._mouseStart(event)!==false); if(!this._mouseStarted){ event.preventDefault(); return true; }} if(true===$.data(event.target, this.widgetName + ".preventClickEvent")){ $.removeData(event.target, this.widgetName + ".preventClickEvent"); } this._mouseMoveDelegate=function(event){ return that._mouseMove(event); }; this._mouseUpDelegate=function(event){ return that._mouseUp(event); }; this.document .bind("mousemove." + this.widgetName, this._mouseMoveDelegate) .bind("mouseup." + this.widgetName, this._mouseUpDelegate); event.preventDefault(); mouseHandled=true; return true; }, _mouseMove: function(event){ if(this._mouseMoved){ if($.ui.ie&&(!document.documentMode||document.documentMode < 9)&&!event.button){ return this._mouseUp(event); }else if(!event.which){ return this._mouseUp(event); }} if(event.which||event.button){ this._mouseMoved=true; } if(this._mouseStarted){ this._mouseDrag(event); return event.preventDefault(); } if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){ this._mouseStarted = (this._mouseStart(this._mouseDownEvent, event)!==false); (this._mouseStarted ? this._mouseDrag(event):this._mouseUp(event)); } return !this._mouseStarted; }, _mouseUp: function(event){ this.document .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if(this._mouseStarted){ this._mouseStarted=false; if(event.target===this._mouseDownEvent.target){ $.data(event.target, this.widgetName + ".preventClickEvent", true); } this._mouseStop(event); } mouseHandled=false; return false; }, _mouseDistanceMet: function(event){ return (Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY) ) >=this.options.distance ); }, _mouseDelayMet: function(){ return this.mouseDelayMet; }, _mouseStart: function(){}, _mouseDrag: function(){}, _mouseStop: function(){}, _mouseCapture: function(){ return true; }}); (function(){ $.ui=$.ui||{}; var cachedScrollbarWidth, supportsOffsetFractions, max=Math.max, abs=Math.abs, round=Math.round, rhorizontal=/left|center|right/, rvertical=/top|center|bottom/, roffset=/[\+\-]\d+(\.[\d]+)?%?/, rposition=/^\w+/, rpercent=/%$/, _position=$.fn.position; function getOffsets(offsets, width, height){ return [ parseFloat(offsets[ 0 ]) *(rpercent.test(offsets[ 0 ]) ? width / 100:1), parseFloat(offsets[ 1 ]) *(rpercent.test(offsets[ 1 ]) ? height / 100:1) ]; } function parseCss(element, property){ return parseInt($.css(element, property), 10)||0; } function getDimensions(elem){ var raw=elem[0]; if(raw.nodeType===9){ return { width: elem.width(), height: elem.height(), offset: { top: 0, left: 0 }};} if($.isWindow(raw)){ return { width: elem.width(), height: elem.height(), offset: { top: elem.scrollTop(), left: elem.scrollLeft() }};} if(raw.preventDefault){ return { width: 0, height: 0, offset: { top: raw.pageY, left: raw.pageX }};} return { width: elem.outerWidth(), height: elem.outerHeight(), offset: elem.offset() };} $.position={ scrollbarWidth: function(){ if(cachedScrollbarWidth!==undefined){ return cachedScrollbarWidth; } var w1, w2, div=$("
"), innerDiv=div.children()[0]; $("body").append(div); w1=innerDiv.offsetWidth; div.css("overflow", "scroll"); w2=innerDiv.offsetWidth; if(w1===w2){ w2=div[0].clientWidth; } div.remove(); return (cachedScrollbarWidth=w1 - w2); }, getScrollInfo: function(within){ var overflowX=within.isWindow||within.isDocument ? "" : within.element.css("overflow-x"), overflowY=within.isWindow||within.isDocument ? "" : within.element.css("overflow-y"), hasOverflowX=overflowX==="scroll" || (overflowX==="auto"&&within.width < within.element[0].scrollWidth), hasOverflowY=overflowY==="scroll" || (overflowY==="auto"&&within.height < within.element[0].scrollHeight); return { width: hasOverflowY ? $.position.scrollbarWidth():0, height: hasOverflowX ? $.position.scrollbarWidth():0 };}, getWithinInfo: function(element){ var withinElement=$(element||window), isWindow=$.isWindow(withinElement[0]), isDocument = !!withinElement[ 0 ]&&withinElement[ 0 ].nodeType===9; return { element: withinElement, isWindow: isWindow, isDocument: isDocument, offset: withinElement.offset()||{ left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), scrollTop: withinElement.scrollTop(), width: isWindow||isDocument ? withinElement.width():withinElement.outerWidth(), height: isWindow||isDocument ? withinElement.height():withinElement.outerHeight() };}}; $.fn.position=function(options){ if(!options||!options.of){ return _position.apply(this, arguments); } options=$.extend({}, options); var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, target=$(options.of), within=$.position.getWithinInfo(options.within), scrollInfo=$.position.getScrollInfo(within), collision=(options.collision||"flip").split(" "), offsets={}; dimensions=getDimensions(target); if(target[0].preventDefault){ options.at="left top"; } targetWidth=dimensions.width; targetHeight=dimensions.height; targetOffset=dimensions.offset; basePosition=$.extend({}, targetOffset); $.each([ "my", "at" ], function(){ var pos=(options[ this ]||"").split(" "), horizontalOffset, verticalOffset; if(pos.length===1){ pos=rhorizontal.test(pos[ 0 ]) ? pos.concat([ "center" ]) : rvertical.test(pos[ 0 ]) ? [ "center" ].concat(pos) : [ "center", "center" ]; } pos[ 0 ]=rhorizontal.test(pos[ 0 ]) ? pos[ 0 ]:"center"; pos[ 1 ]=rvertical.test(pos[ 1 ]) ? pos[ 1 ]:"center"; horizontalOffset=roffset.exec(pos[ 0 ]); verticalOffset=roffset.exec(pos[ 1 ]); offsets[ this ]=[ horizontalOffset ? horizontalOffset[ 0 ]:0, verticalOffset ? verticalOffset[ 0 ]:0 ]; options[ this ]=[ rposition.exec(pos[ 0 ])[ 0 ], rposition.exec(pos[ 1 ])[ 0 ] ]; }); if(collision.length===1){ collision[ 1 ]=collision[ 0 ]; } if(options.at[ 0 ]==="right"){ basePosition.left +=targetWidth; }else if(options.at[ 0 ]==="center"){ basePosition.left +=targetWidth / 2; } if(options.at[ 1 ]==="bottom"){ basePosition.top +=targetHeight; }else if(options.at[ 1 ]==="center"){ basePosition.top +=targetHeight / 2; } atOffset=getOffsets(offsets.at, targetWidth, targetHeight); basePosition.left +=atOffset[ 0 ]; basePosition.top +=atOffset[ 1 ]; return this.each(function(){ var collisionPosition, using, elem=$(this), elemWidth=elem.outerWidth(), elemHeight=elem.outerHeight(), marginLeft=parseCss(this, "marginLeft"), marginTop=parseCss(this, "marginTop"), collisionWidth=elemWidth + marginLeft + parseCss(this, "marginRight") + scrollInfo.width, collisionHeight=elemHeight + marginTop + parseCss(this, "marginBottom") + scrollInfo.height, position=$.extend({}, basePosition), myOffset=getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight()); if(options.my[ 0 ]==="right"){ position.left -=elemWidth; }else if(options.my[ 0 ]==="center"){ position.left -=elemWidth / 2; } if(options.my[ 1 ]==="bottom"){ position.top -=elemHeight; }else if(options.my[ 1 ]==="center"){ position.top -=elemHeight / 2; } position.left +=myOffset[ 0 ]; position.top +=myOffset[ 1 ]; if(!supportsOffsetFractions){ position.left=round(position.left); position.top=round(position.top); } collisionPosition={ marginLeft: marginLeft, marginTop: marginTop }; $.each([ "left", "top" ], function(i, dir){ if($.ui.position[ collision[ i ] ]){ $.ui.position[ collision[ i ] ][ dir ](position, { targetWidth: targetWidth, targetHeight: targetHeight, elemWidth: elemWidth, elemHeight: elemHeight, collisionPosition: collisionPosition, collisionWidth: collisionWidth, collisionHeight: collisionHeight, offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], my: options.my, at: options.at, within: within, elem: elem }); }}); if(options.using){ using=function(props){ var left=targetOffset.left - position.left, right=left + targetWidth - elemWidth, top=targetOffset.top - position.top, bottom=top + targetHeight - elemHeight, feedback={ target: { element: target, left: targetOffset.left, top: targetOffset.top, width: targetWidth, height: targetHeight }, element: { element: elem, left: position.left, top: position.top, width: elemWidth, height: elemHeight }, horizontal: right < 0 ? "left":left > 0 ? "right":"center", vertical: bottom < 0 ? "top":top > 0 ? "bottom":"middle" }; if(targetWidth < elemWidth&&abs(left + right) < targetWidth){ feedback.horizontal="center"; } if(targetHeight < elemHeight&&abs(top + bottom) < targetHeight){ feedback.vertical="middle"; } if(max(abs(left), abs(right)) > max(abs(top), abs(bottom))){ feedback.important="horizontal"; }else{ feedback.important="vertical"; } options.using.call(this, props, feedback); };} elem.offset($.extend(position, { using: using })); }); }; $.ui.position={ fit: { left: function(position, data){ var within=data.within, withinOffset=within.isWindow ? within.scrollLeft:within.offset.left, outerWidth=within.width, collisionPosLeft=position.left - data.collisionPosition.marginLeft, overLeft=withinOffset - collisionPosLeft, overRight=collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, newOverRight; if(data.collisionWidth > outerWidth){ if(overLeft > 0&&overRight <=0){ newOverRight=position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; position.left +=overLeft - newOverRight; }else if(overRight > 0&&overLeft <=0){ position.left=withinOffset; }else{ if(overLeft > overRight){ position.left=withinOffset + outerWidth - data.collisionWidth; }else{ position.left=withinOffset; }} }else if(overLeft > 0){ position.left +=overLeft; }else if(overRight > 0){ position.left -=overRight; }else{ position.left=max(position.left - collisionPosLeft, position.left); }}, top: function(position, data){ var within=data.within, withinOffset=within.isWindow ? within.scrollTop:within.offset.top, outerHeight=data.within.height, collisionPosTop=position.top - data.collisionPosition.marginTop, overTop=withinOffset - collisionPosTop, overBottom=collisionPosTop + data.collisionHeight - outerHeight - withinOffset, newOverBottom; if(data.collisionHeight > outerHeight){ if(overTop > 0&&overBottom <=0){ newOverBottom=position.top + overTop + data.collisionHeight - outerHeight - withinOffset; position.top +=overTop - newOverBottom; }else if(overBottom > 0&&overTop <=0){ position.top=withinOffset; }else{ if(overTop > overBottom){ position.top=withinOffset + outerHeight - data.collisionHeight; }else{ position.top=withinOffset; }} }else if(overTop > 0){ position.top +=overTop; }else if(overBottom > 0){ position.top -=overBottom; }else{ position.top=max(position.top - collisionPosTop, position.top); }} }, flip: { left: function(position, data){ var within=data.within, withinOffset=within.offset.left + within.scrollLeft, outerWidth=within.width, offsetLeft=within.isWindow ? within.scrollLeft:within.offset.left, collisionPosLeft=position.left - data.collisionPosition.marginLeft, overLeft=collisionPosLeft - offsetLeft, overRight=collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, myOffset=data.my[ 0 ]==="left" ? -data.elemWidth : data.my[ 0 ]==="right" ? data.elemWidth : 0, atOffset=data.at[ 0 ]==="left" ? data.targetWidth : data.at[ 0 ]==="right" ? -data.targetWidth : 0, offset=-2 * data.offset[ 0 ], newOverRight, newOverLeft; if(overLeft < 0){ newOverRight=position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; if(newOverRight < 0||newOverRight < abs(overLeft)){ position.left +=myOffset + atOffset + offset; }}else if(overRight > 0){ newOverLeft=position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; if(newOverLeft > 0||abs(newOverLeft) < overRight){ position.left +=myOffset + atOffset + offset; }} }, top: function(position, data){ var within=data.within, withinOffset=within.offset.top + within.scrollTop, outerHeight=within.height, offsetTop=within.isWindow ? within.scrollTop:within.offset.top, collisionPosTop=position.top - data.collisionPosition.marginTop, overTop=collisionPosTop - offsetTop, overBottom=collisionPosTop + data.collisionHeight - outerHeight - offsetTop, top=data.my[ 1 ]==="top", myOffset=top ? -data.elemHeight : data.my[ 1 ]==="bottom" ? data.elemHeight : 0, atOffset=data.at[ 1 ]==="top" ? data.targetHeight : data.at[ 1 ]==="bottom" ? -data.targetHeight : 0, offset=-2 * data.offset[ 1 ], newOverTop, newOverBottom; if(overTop < 0){ newOverBottom=position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; if(newOverBottom < 0||newOverBottom < abs(overTop)){ position.top +=myOffset + atOffset + offset; }}else if(overBottom > 0){ newOverTop=position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; if(newOverTop > 0||abs(newOverTop) < overBottom){ position.top +=myOffset + atOffset + offset; }} }}, flipfit: { left: function(){ $.ui.position.flip.left.apply(this, arguments); $.ui.position.fit.left.apply(this, arguments); }, top: function(){ $.ui.position.flip.top.apply(this, arguments); $.ui.position.fit.top.apply(this, arguments); }} }; (function(){ var testElement, testElementParent, testElementStyle, offsetLeft, i, body=document.getElementsByTagName("body")[ 0 ], div=document.createElement("div"); testElement=document.createElement(body ? "div":"body"); testElementStyle={ visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }; if(body){ $.extend(testElementStyle, { position: "absolute", left: "-1000px", top: "-1000px" }); } for(i in testElementStyle){ testElement.style[ i ]=testElementStyle[ i ]; } testElement.appendChild(div); testElementParent=body||document.documentElement; testElementParent.insertBefore(testElement, testElementParent.firstChild); div.style.cssText="position: absolute; left: 10.7432222px;"; offsetLeft=$(div).offset().left; supportsOffsetFractions=offsetLeft > 10&&offsetLeft < 11; testElement.innerHTML=""; testElementParent.removeChild(testElement); })(); })(); var position=$.ui.position; var accordion=$.widget("ui.accordion", { version: "1.11.4", options: { active: 0, animate: {}, collapsible: false, event: "click", header: "> li > :first-child,> :not(li):even", heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e" }, activate: null, beforeActivate: null }, hideProps: { borderTopWidth: "hide", borderBottomWidth: "hide", paddingTop: "hide", paddingBottom: "hide", height: "hide" }, showProps: { borderTopWidth: "show", borderBottomWidth: "show", paddingTop: "show", paddingBottom: "show", height: "show" }, _create: function(){ var options=this.options; this.prevShow=this.prevHide=$(); this.element.addClass("ui-accordion ui-widget ui-helper-reset") .attr("role", "tablist"); if(!options.collapsible&&(options.active===false||options.active==null)){ options.active=0; } this._processPanels(); if(options.active < 0){ options.active +=this.headers.length; } this._refresh(); }, _getCreateEventData: function(){ return { header: this.active, panel: !this.active.length ? $():this.active.next() };}, _createIcons: function(){ var icons=this.options.icons; if(icons){ $("") .addClass("ui-accordion-header-icon ui-icon " + icons.header) .prependTo(this.headers); this.active.children(".ui-accordion-header-icon") .removeClass(icons.header) .addClass(icons.activeHeader); this.headers.addClass("ui-accordion-icons"); }}, _destroyIcons: function(){ this.headers .removeClass("ui-accordion-icons") .children(".ui-accordion-header-icon") .remove(); }, _destroy: function(){ var contents; this.element .removeClass("ui-accordion ui-widget ui-helper-reset") .removeAttr("role"); this.headers .removeClass("ui-accordion-header ui-accordion-header-active ui-state-default " + "ui-corner-all ui-state-active ui-state-disabled ui-corner-top") .removeAttr("role") .removeAttr("aria-expanded") .removeAttr("aria-selected") .removeAttr("aria-controls") .removeAttr("tabIndex") .removeUniqueId(); this._destroyIcons(); contents=this.headers.next() .removeClass("ui-helper-reset ui-widget-content ui-corner-bottom " + "ui-accordion-content ui-accordion-content-active ui-state-disabled") .css("display", "") .removeAttr("role") .removeAttr("aria-hidden") .removeAttr("aria-labelledby") .removeUniqueId(); if(this.options.heightStyle!=="content"){ contents.css("height", ""); }}, _setOption: function(key, value){ if(key==="active"){ this._activate(value); return; } if(key==="event"){ if(this.options.event){ this._off(this.headers, this.options.event); } this._setupEvents(value); } this._super(key, value); if(key==="collapsible"&&!value&&this.options.active===false){ this._activate(0); } if(key==="icons"){ this._destroyIcons(); if(value){ this._createIcons(); }} if(key==="disabled"){ this.element .toggleClass("ui-state-disabled", !!value) .attr("aria-disabled", value); this.headers.add(this.headers.next()) .toggleClass("ui-state-disabled", !!value); }}, _keydown: function(event){ if(event.altKey||event.ctrlKey){ return; } var keyCode=$.ui.keyCode, length=this.headers.length, currentIndex=this.headers.index(event.target), toFocus=false; switch(event.keyCode){ case keyCode.RIGHT: case keyCode.DOWN: toFocus=this.headers[(currentIndex + 1) % length ]; break; case keyCode.LEFT: case keyCode.UP: toFocus=this.headers[(currentIndex - 1 + length) % length ]; break; case keyCode.SPACE: case keyCode.ENTER: this._eventHandler(event); break; case keyCode.HOME: toFocus=this.headers[ 0 ]; break; case keyCode.END: toFocus=this.headers[ length - 1 ]; break; } if(toFocus){ $(event.target).attr("tabIndex", -1); $(toFocus).attr("tabIndex", 0); toFocus.focus(); event.preventDefault(); }}, _panelKeyDown: function(event){ if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){ $(event.currentTarget).prev().focus(); }}, refresh: function(){ var options=this.options; this._processPanels(); if(( options.active===false&&options.collapsible===true)||!this.headers.length){ options.active=false; this.active=$(); }else if(options.active===false){ this._activate(0); }else if(this.active.length&&!$.contains(this.element[ 0 ], this.active[ 0 ])){ if(this.headers.length===this.headers.find(".ui-state-disabled").length){ options.active=false; this.active=$(); }else{ this._activate(Math.max(0, options.active - 1)); }}else{ options.active=this.headers.index(this.active); } this._destroyIcons(); this._refresh(); }, _processPanels: function(){ var prevHeaders=this.headers, prevPanels=this.panels; this.headers=this.element.find(this.options.header) .addClass("ui-accordion-header ui-state-default ui-corner-all"); this.panels=this.headers.next() .addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom") .filter(":not(.ui-accordion-content-active)") .hide(); if(prevPanels){ this._off(prevHeaders.not(this.headers)); this._off(prevPanels.not(this.panels)); }}, _refresh: function(){ var maxHeight, options=this.options, heightStyle=options.heightStyle, parent=this.element.parent(); this.active=this._findActive(options.active) .addClass("ui-accordion-header-active ui-state-active ui-corner-top") .removeClass("ui-corner-all"); this.active.next() .addClass("ui-accordion-content-active") .show(); this.headers .attr("role", "tab") .each(function(){ var header=$(this), headerId=header.uniqueId().attr("id"), panel=header.next(), panelId=panel.uniqueId().attr("id"); header.attr("aria-controls", panelId); panel.attr("aria-labelledby", headerId); }) .next() .attr("role", "tabpanel"); this.headers .not(this.active) .attr({ "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 }) .next() .attr({ "aria-hidden": "true" }) .hide(); if(!this.active.length){ this.headers.eq(0).attr("tabIndex", 0); }else{ this.active.attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }) .next() .attr({ "aria-hidden": "false" }); } this._createIcons(); this._setupEvents(options.event); if(heightStyle==="fill"){ maxHeight=parent.height(); this.element.siblings(":visible").each(function(){ var elem=$(this), position=elem.css("position"); if(position==="absolute"||position==="fixed"){ return; } maxHeight -=elem.outerHeight(true); }); this.headers.each(function(){ maxHeight -=$(this).outerHeight(true); }); this.headers.next() .each(function(){ $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height())); }) .css("overflow", "auto"); }else if(heightStyle==="auto"){ maxHeight=0; this.headers.next() .each(function(){ maxHeight=Math.max(maxHeight, $(this).css("height", "").height()); }) .height(maxHeight); }}, _activate: function(index){ var active=this._findActive(index)[ 0 ]; if(active===this.active[ 0 ]){ return; } active=active||this.active[ 0 ]; this._eventHandler({ target: active, currentTarget: active, preventDefault: $.noop }); }, _findActive: function(selector){ return typeof selector==="number" ? this.headers.eq(selector):$(); }, _setupEvents: function(event){ var events={ keydown: "_keydown" }; if(event){ $.each(event.split(" "), function(index, eventName){ events[ eventName ]="_eventHandler"; }); } this._off(this.headers.add(this.headers.next())); this._on(this.headers, events); this._on(this.headers.next(), { keydown: "_panelKeyDown" }); this._hoverable(this.headers); this._focusable(this.headers); }, _eventHandler: function(event){ var options=this.options, active=this.active, clicked=$(event.currentTarget), clickedIsActive=clicked[ 0 ]===active[ 0 ], collapsing=clickedIsActive&&options.collapsible, toShow=collapsing ? $():clicked.next(), toHide=active.next(), eventData={ oldHeader: active, oldPanel: toHide, newHeader: collapsing ? $():clicked, newPanel: toShow }; event.preventDefault(); if((clickedIsActive&&!options.collapsible) || (this._trigger("beforeActivate", event, eventData)===false)){ return; } options.active=collapsing ? false:this.headers.index(clicked); this.active=clickedIsActive ? $():clicked; this._toggle(eventData); active.removeClass("ui-accordion-header-active ui-state-active"); if(options.icons){ active.children(".ui-accordion-header-icon") .removeClass(options.icons.activeHeader) .addClass(options.icons.header); } if(!clickedIsActive){ clicked .removeClass("ui-corner-all") .addClass("ui-accordion-header-active ui-state-active ui-corner-top"); if(options.icons){ clicked.children(".ui-accordion-header-icon") .removeClass(options.icons.header) .addClass(options.icons.activeHeader); } clicked .next() .addClass("ui-accordion-content-active"); }}, _toggle: function(data){ var toShow=data.newPanel, toHide=this.prevShow.length ? this.prevShow:data.oldPanel; this.prevShow.add(this.prevHide).stop(true, true); this.prevShow=toShow; this.prevHide=toHide; if(this.options.animate){ this._animate(toShow, toHide, data); }else{ toHide.hide(); toShow.show(); this._toggleComplete(data); } toHide.attr({ "aria-hidden": "true" }); toHide.prev().attr({ "aria-selected": "false", "aria-expanded": "false" }); if(toShow.length&&toHide.length){ toHide.prev().attr({ "tabIndex": -1, "aria-expanded": "false" }); }else if(toShow.length){ this.headers.filter(function(){ return parseInt($(this).attr("tabIndex"), 10)===0; }) .attr("tabIndex", -1); } toShow .attr("aria-hidden", "false") .prev() .attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }); }, _animate: function(toShow, toHide, data){ var total, easing, duration, that=this, adjust=0, boxSizing=toShow.css("box-sizing"), down=toShow.length && (!toHide.length||(toShow.index() < toHide.index())), animate=this.options.animate||{}, options=down&&animate.down||animate, complete=function(){ that._toggleComplete(data); }; if(typeof options==="number"){ duration=options; } if(typeof options==="string"){ easing=options; } easing=easing||options.easing||animate.easing; duration=duration||options.duration||animate.duration; if(!toHide.length){ return toShow.animate(this.showProps, duration, easing, complete); } if(!toShow.length){ return toHide.animate(this.hideProps, duration, easing, complete); } total=toShow.show().outerHeight(); toHide.animate(this.hideProps, { duration: duration, easing: easing, step: function(now, fx){ fx.now=Math.round(now); }}); toShow .hide() .animate(this.showProps, { duration: duration, easing: easing, complete: complete, step: function(now, fx){ fx.now=Math.round(now); if(fx.prop!=="height"){ if(boxSizing==="content-box"){ adjust +=fx.now; }}else if(that.options.heightStyle!=="content"){ fx.now=Math.round(total - toHide.outerHeight() - adjust); adjust=0; }} }); }, _toggleComplete: function(data){ var toHide=data.oldPanel; toHide .removeClass("ui-accordion-content-active") .prev() .removeClass("ui-corner-top") .addClass("ui-corner-all"); if(toHide.length){ toHide.parent()[ 0 ].className=toHide.parent()[ 0 ].className; } this._trigger("activate", null, data); }}); var menu=$.widget("ui.menu", { version: "1.11.4", defaultElement: "
" + ""; thead=(showWeek ? "":""); for (dow=0; dow < 7; dow++){ day=(dow + firstDay) % 7; thead +=""; } calender +=thead + ""; daysInMonth=this._getDaysInMonth(drawYear, drawMonth); if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){ inst.selectedDay=Math.min(inst.selectedDay, daysInMonth); } leadDays=(this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; curRows=Math.ceil((leadDays + daysInMonth) / 7); numRows=(isMultiMonth ? this.maxRows > curRows ? this.maxRows:curRows:curRows); this.maxRows=numRows; printDate=this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); for (dRow=0; dRow < numRows; dRow++){ calender +=""; tbody=(!showWeek ? "":""); for (dow=0; dow < 7; dow++){ daySettings=(beforeShowDay ? beforeShowDay.apply((inst.input ? inst.input[0]:null), [printDate]):[true, ""]); otherMonth=(printDate.getMonth()!==drawMonth); unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0] || (minDate&&printDate < minDate)||(maxDate&&printDate > maxDate); tbody +=""; printDate.setDate(printDate.getDate() + 1); printDate=this._daylightSavingAdjust(printDate); } calender +=tbody + ""; } drawMonth++; if(drawMonth > 11){ drawMonth=0; drawYear++; } calender +="
" + this._get(inst, "weekHeader") + "=5 ? " class='ui-datepicker-week-end'":"") + ">" + "" + dayNamesMin[day] + "
" + this._get(inst, "calculateWeek")(printDate) + "" + (otherMonth&&!showOtherMonths ? " " : (unselectable ? "" + printDate.getDate() + "":"" + printDate.getDate() + "")) + "
" + (isMultiMonth ? "" + ((numMonths[0] > 0&&col===numMonths[1]-1) ? "
":""):""); group +=calender; } html +=group; } html +=buttonPanel; inst._keyEvent=false; return html; }, _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort){ var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, changeMonth=this._get(inst, "changeMonth"), changeYear=this._get(inst, "changeYear"), showMonthAfterYear=this._get(inst, "showMonthAfterYear"), html="
", monthHtml=""; if(secondary||!changeMonth){ monthHtml +="" + monthNames[drawMonth] + ""; }else{ inMinYear=(minDate&&minDate.getFullYear()===drawYear); inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear); monthHtml +=""; } if(!showMonthAfterYear){ html +=monthHtml + (secondary||!(changeMonth&&changeYear) ? " ":""); } if(!inst.yearshtml){ inst.yearshtml=""; if(secondary||!changeYear){ html +="" + drawYear + ""; }else{ years=this._get(inst, "yearRange").split(":"); thisYear=new Date().getFullYear(); determineYear=function(value){ var year=(value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10))); return (isNaN(year) ? thisYear:year); }; year=determineYear(years[0]); endYear=Math.max(year, determineYear(years[1]||"")); year=(minDate ? Math.max(year, minDate.getFullYear()):year); endYear=(maxDate ? Math.min(endYear, maxDate.getFullYear()):endYear); inst.yearshtml +=""; html +=inst.yearshtml; inst.yearshtml=null; }} html +=this._get(inst, "yearSuffix"); if(showMonthAfterYear){ html +=(secondary||!(changeMonth&&changeYear) ? " ":"") + monthHtml; } html +="
"; return html; }, _adjustInstDate: function(inst, offset, period){ var year=inst.drawYear + (period==="Y" ? offset:0), month=inst.drawMonth + (period==="M" ? offset:0), day=Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period==="D" ? offset:0), date=this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); inst.selectedDay=date.getDate(); inst.drawMonth=inst.selectedMonth=date.getMonth(); inst.drawYear=inst.selectedYear=date.getFullYear(); if(period==="M"||period==="Y"){ this._notifyChange(inst); }}, _restrictMinMax: function(inst, date){ var minDate=this._getMinMaxDate(inst, "min"), maxDate=this._getMinMaxDate(inst, "max"), newDate=(minDate&&date < minDate ? minDate:date); return (maxDate&&newDate > maxDate ? maxDate:newDate); }, _notifyChange: function(inst){ var onChange=this._get(inst, "onChangeMonthYear"); if(onChange){ onChange.apply((inst.input ? inst.input[0]:null), [inst.selectedYear, inst.selectedMonth + 1, inst]); }}, _getNumberOfMonths: function(inst){ var numMonths=this._get(inst, "numberOfMonths"); return (numMonths==null ? [1, 1]:(typeof numMonths==="number" ? [1, numMonths]:numMonths)); }, _getMinMaxDate: function(inst, minMax){ return this._determineDate(inst, this._get(inst, minMax + "Date"), null); }, _getDaysInMonth: function(year, month){ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); }, _getFirstDayOfMonth: function(year, month){ return new Date(year, month, 1).getDay(); }, _canAdjustMonth: function(inst, offset, curYear, curMonth){ var numMonths=this._getNumberOfMonths(inst), date=this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset:numMonths[0] * numMonths[1]), 1)); if(offset < 0){ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); } return this._isInRange(inst, date); }, _isInRange: function(inst, date){ var yearSplit, currentYear, minDate=this._getMinMaxDate(inst, "min"), maxDate=this._getMinMaxDate(inst, "max"), minYear=null, maxYear=null, years=this._get(inst, "yearRange"); if(years){ yearSplit=years.split(":"); currentYear=new Date().getFullYear(); minYear=parseInt(yearSplit[0], 10); maxYear=parseInt(yearSplit[1], 10); if(yearSplit[0].match(/[+\-].*/)){ minYear +=currentYear; } if(yearSplit[1].match(/[+\-].*/)){ maxYear +=currentYear; }} return ((!minDate||date.getTime() >=minDate.getTime()) && (!maxDate||date.getTime() <=maxDate.getTime()) && (!minYear||date.getFullYear() >=minYear) && (!maxYear||date.getFullYear() <=maxYear)); }, _getFormatConfig: function(inst){ var shortYearCutoff=this._get(inst, "shortYearCutoff"); shortYearCutoff=(typeof shortYearCutoff!=="string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); return {shortYearCutoff: shortYearCutoff, dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};}, _formatDate: function(inst, day, month, year){ if(!day){ inst.currentDay=inst.selectedDay; inst.currentMonth=inst.selectedMonth; inst.currentYear=inst.selectedYear; } var date=(day ? (typeof day==="object" ? day : this._daylightSavingAdjust(new Date(year, month, day))) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)); }}); function datepicker_bindHover(dpDiv){ var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return dpDiv.delegate(selector, "mouseout", function(){ $(this).removeClass("ui-state-hover"); if(this.className.indexOf("ui-datepicker-prev")!==-1){ $(this).removeClass("ui-datepicker-prev-hover"); } if(this.className.indexOf("ui-datepicker-next")!==-1){ $(this).removeClass("ui-datepicker-next-hover"); }}) .delegate(selector, "mouseover", datepicker_handleMouseover); } function datepicker_handleMouseover(){ if(!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0]:datepicker_instActive.input[0])){ $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); $(this).addClass("ui-state-hover"); if(this.className.indexOf("ui-datepicker-prev")!==-1){ $(this).addClass("ui-datepicker-prev-hover"); } if(this.className.indexOf("ui-datepicker-next")!==-1){ $(this).addClass("ui-datepicker-next-hover"); }} } function datepicker_extendRemove(target, props){ $.extend(target, props); for (var name in props){ if(props[name]==null){ target[name]=props[name]; }} return target; } $.fn.datepicker=function(options){ if(!this.length){ return this; } if(!$.datepicker.initialized){ $(document).mousedown($.datepicker._checkExternalClick); $.datepicker.initialized=true; } if($("#"+$.datepicker._mainDivId).length===0){ $("body").append($.datepicker.dpDiv); } var otherArgs=Array.prototype.slice.call(arguments, 1); if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget")){ return $.datepicker["_" + options + "Datepicker"]. apply($.datepicker, [this[0]].concat(otherArgs)); } if(options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){ return $.datepicker["_" + options + "Datepicker"]. apply($.datepicker, [this[0]].concat(otherArgs)); } return this.each(function(){ typeof options==="string" ? $.datepicker["_" + options + "Datepicker"]. apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options); }); }; $.datepicker=new Datepicker(); $.datepicker.initialized=false; $.datepicker.uuid=new Date().getTime(); $.datepicker.version="1.11.4"; var datepicker=$.datepicker; $.widget("ui.draggable", $.ui.mouse, { version: "1.11.4", widgetEventPrefix: "drag", options: { addClasses: true, appendTo: "parent", axis: false, connectToSortable: false, containment: false, cursor: "auto", cursorAt: false, grid: false, handle: false, helper: "original", iframeFix: false, opacity: false, refreshPositions: false, revert: false, revertDuration: 500, scope: "default", scroll: true, scrollSensitivity: 20, scrollSpeed: 20, snap: false, snapMode: "both", snapTolerance: 20, stack: false, zIndex: false, drag: null, start: null, stop: null }, _create: function(){ if(this.options.helper==="original"){ this._setPositionRelative(); } if(this.options.addClasses){ this.element.addClass("ui-draggable"); } if(this.options.disabled){ this.element.addClass("ui-draggable-disabled"); } this._setHandleClassName(); this._mouseInit(); }, _setOption: function(key, value){ this._super(key, value); if(key==="handle"){ this._removeHandleClassName(); this._setHandleClassName(); }}, _destroy: function(){ if(( this.helper||this.element).is(".ui-draggable-dragging")){ this.destroyOnClear=true; return; } this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._removeHandleClassName(); this._mouseDestroy(); }, _mouseCapture: function(event){ var o=this.options; this._blurActiveElement(event); if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length > 0){ return false; } this.handle=this._getHandle(event); if(!this.handle){ return false; } this._blockFrames(o.iframeFix===true ? "iframe":o.iframeFix); return true; }, _blockFrames: function(selector){ this.iframeBlocks=this.document.find(selector).map(function(){ var iframe=$(this); return $("
") .css("position", "absolute") .appendTo(iframe.parent()) .outerWidth(iframe.outerWidth()) .outerHeight(iframe.outerHeight()) .offset(iframe.offset())[ 0 ]; }); }, _unblockFrames: function(){ if(this.iframeBlocks){ this.iframeBlocks.remove(); delete this.iframeBlocks; }}, _blurActiveElement: function(event){ var document=this.document[ 0 ]; if(!this.handleElement.is(event.target)){ return; } try { if(document.activeElement&&document.activeElement.nodeName.toLowerCase()!=="body"){ $(document.activeElement).blur(); }} catch(error){}}, _mouseStart: function(event){ var o=this.options; this.helper=this._createHelper(event); this.helper.addClass("ui-draggable-dragging"); this._cacheHelperProportions(); if($.ui.ddmanager){ $.ui.ddmanager.current=this; } this._cacheMargins(); this.cssPosition=this.helper.css("position"); this.scrollParent=this.helper.scrollParent(true); this.offsetParent=this.helper.offsetParent(); this.hasFixedAncestor=this.helper.parents().filter(function(){ return $(this).css("position")==="fixed"; }).length > 0; this.positionAbs=this.element.offset(); this._refreshOffsets(event); this.originalPosition=this.position=this._generatePosition(event, false); this.originalPageX=event.pageX; this.originalPageY=event.pageY; (o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt)); this._setContainment(); if(this._trigger("start", event)===false){ this._clear(); return false; } this._cacheHelperProportions(); if($.ui.ddmanager&&!o.dropBehaviour){ $.ui.ddmanager.prepareOffsets(this, event); } this._normalizeRightBottom(); this._mouseDrag(event, true); if($.ui.ddmanager){ $.ui.ddmanager.dragStart(this, event); } return true; }, _refreshOffsets: function(event){ this.offset={ top: this.positionAbs.top - this.margins.top, left: this.positionAbs.left - this.margins.left, scroll: false, parent: this._getParentOffset(), relative: this._getRelativeOffset() }; this.offset.click={ left: event.pageX - this.offset.left, top: event.pageY - this.offset.top };}, _mouseDrag: function(event, noPropagation){ if(this.hasFixedAncestor){ this.offset.parent=this._getParentOffset(); } this.position=this._generatePosition(event, true); this.positionAbs=this._convertPositionTo("absolute"); if(!noPropagation){ var ui=this._uiHash(); if(this._trigger("drag", event, ui)===false){ this._mouseUp({}); return false; } this.position=ui.position; } this.helper[ 0 ].style.left=this.position.left + "px"; this.helper[ 0 ].style.top=this.position.top + "px"; if($.ui.ddmanager){ $.ui.ddmanager.drag(this, event); } return false; }, _mouseStop: function(event){ var that=this, dropped=false; if($.ui.ddmanager&&!this.options.dropBehaviour){ dropped=$.ui.ddmanager.drop(this, event); } if(this.dropped){ dropped=this.dropped; this.dropped=false; } if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element, dropped))){ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function(){ if(that._trigger("stop", event)!==false){ that._clear(); }}); }else{ if(this._trigger("stop", event)!==false){ this._clear(); }} return false; }, _mouseUp: function(event){ this._unblockFrames(); if($.ui.ddmanager){ $.ui.ddmanager.dragStop(this, event); } if(this.handleElement.is(event.target)){ this.element.focus(); } return $.ui.mouse.prototype._mouseUp.call(this, event); }, cancel: function(){ if(this.helper.is(".ui-draggable-dragging")){ this._mouseUp({}); }else{ this._clear(); } return this; }, _getHandle: function(event){ return this.options.handle ? !!$(event.target).closest(this.element.find(this.options.handle)).length : true; }, _setHandleClassName: function(){ this.handleElement=this.options.handle ? this.element.find(this.options.handle):this.element; this.handleElement.addClass("ui-draggable-handle"); }, _removeHandleClassName: function(){ this.handleElement.removeClass("ui-draggable-handle"); }, _createHelper: function(event){ var o=this.options, helperIsFunction=$.isFunction(o.helper), helper=helperIsFunction ? $(o.helper.apply(this.element[ 0 ], [ event ])) : (o.helper==="clone" ? this.element.clone().removeAttr("id") : this.element); if(!helper.parents("body").length){ helper.appendTo((o.appendTo==="parent" ? this.element[0].parentNode:o.appendTo)); } if(helperIsFunction&&helper[ 0 ]===this.element[ 0 ]){ this._setPositionRelative(); } if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){ helper.css("position", "absolute"); } return helper; }, _setPositionRelative: function(){ if(!(/^(?:r|a|f)/).test(this.element.css("position"))){ this.element[ 0 ].style.position="relative"; }}, _adjustOffsetFromHelper: function(obj){ if(typeof obj==="string"){ obj=obj.split(" "); } if($.isArray(obj)){ obj={ left: +obj[0], top: +obj[1]||0 };} if("left" in obj){ this.offset.click.left=obj.left + this.margins.left; } if("right" in obj){ this.offset.click.left=this.helperProportions.width - obj.right + this.margins.left; } if("top" in obj){ this.offset.click.top=obj.top + this.margins.top; } if("bottom" in obj){ this.offset.click.top=this.helperProportions.height - obj.bottom + this.margins.top; }}, _isRootNode: function(element){ return(/(html|body)/i).test(element.tagName)||element===this.document[ 0 ]; }, _getParentOffset: function(){ var po=this.offsetParent.offset(), document=this.document[ 0 ]; if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0], this.offsetParent[0])){ po.left +=this.scrollParent.scrollLeft(); po.top +=this.scrollParent.scrollTop(); } if(this._isRootNode(this.offsetParent[ 0 ])){ po={ top: 0, left: 0 };} return { top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10)||0), left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0) };}, _getRelativeOffset: function(){ if(this.cssPosition!=="relative"){ return { top: 0, left: 0 };} var p=this.element.position(), scrollIsRootNode=this._isRootNode(this.scrollParent[ 0 ]); return { top: p.top -(parseInt(this.helper.css("top"), 10)||0) +(!scrollIsRootNode ? this.scrollParent.scrollTop():0), left: p.left -(parseInt(this.helper.css("left"), 10)||0) +(!scrollIsRootNode ? this.scrollParent.scrollLeft():0) };}, _cacheMargins: function(){ this.margins={ left: (parseInt(this.element.css("marginLeft"), 10)||0), top: (parseInt(this.element.css("marginTop"), 10)||0), right: (parseInt(this.element.css("marginRight"), 10)||0), bottom: (parseInt(this.element.css("marginBottom"), 10)||0) };}, _cacheHelperProportions: function(){ this.helperProportions={ width: this.helper.outerWidth(), height: this.helper.outerHeight() };}, _setContainment: function(){ var isUserScrollable, c, ce, o=this.options, document=this.document[ 0 ]; this.relativeContainer=null; if(!o.containment){ this.containment=null; return; } if(o.containment==="window"){ this.containment=[ $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, $(window).scrollLeft() + $(window).width() - this.helperProportions.width - this.margins.left, $(window).scrollTop() +($(window).height()||document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top ]; return; } if(o.containment==="document"){ this.containment=[ 0, 0, $(document).width() - this.helperProportions.width - this.margins.left, ($(document).height()||document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top ]; return; } if(o.containment.constructor===Array){ this.containment=o.containment; return; } if(o.containment==="parent"){ o.containment=this.helper[ 0 ].parentNode; } c=$(o.containment); ce=c[ 0 ]; if(!ce){ return; } isUserScrollable=/(scroll|auto)/.test(c.css("overflow")); this.containment=[ (parseInt(c.css("borderLeftWidth"), 10)||0) +(parseInt(c.css("paddingLeft"), 10)||0), (parseInt(c.css("borderTopWidth"), 10)||0) +(parseInt(c.css("paddingTop"), 10)||0), (isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth):ce.offsetWidth) - (parseInt(c.css("borderRightWidth"), 10)||0) - (parseInt(c.css("paddingRight"), 10)||0) - this.helperProportions.width - this.margins.left - this.margins.right, (isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight):ce.offsetHeight) - (parseInt(c.css("borderBottomWidth"), 10)||0) - (parseInt(c.css("paddingBottom"), 10)||0) - this.helperProportions.height - this.margins.top - this.margins.bottom ]; this.relativeContainer=c; }, _convertPositionTo: function(d, pos){ if(!pos){ pos=this.position; } var mod=d==="absolute" ? 1:-1, scrollIsRootNode=this._isRootNode(this.scrollParent[ 0 ]); return { top: ( pos.top + this.offset.relative.top * mod + this.offset.parent.top * mod - (( this.cssPosition==="fixed" ? -this.offset.scroll.top:(scrollIsRootNode ? 0:this.offset.scroll.top)) * mod) ), left: ( pos.left + this.offset.relative.left * mod + this.offset.parent.left * mod - (( this.cssPosition==="fixed" ? -this.offset.scroll.left:(scrollIsRootNode ? 0:this.offset.scroll.left)) * mod) ) };}, _generatePosition: function(event, constrainPosition){ var containment, co, top, left, o=this.options, scrollIsRootNode=this._isRootNode(this.scrollParent[ 0 ]), pageX=event.pageX, pageY=event.pageY; if(!scrollIsRootNode||!this.offset.scroll){ this.offset.scroll={ top: this.scrollParent.scrollTop(), left: this.scrollParent.scrollLeft() };} if(constrainPosition){ if(this.containment){ if(this.relativeContainer){ co=this.relativeContainer.offset(); containment=[ this.containment[ 0 ] + co.left, this.containment[ 1 ] + co.top, this.containment[ 2 ] + co.left, this.containment[ 3 ] + co.top ]; }else{ containment=this.containment; } if(event.pageX - this.offset.click.left < containment[0]){ pageX=containment[0] + this.offset.click.left; } if(event.pageY - this.offset.click.top < containment[1]){ pageY=containment[1] + this.offset.click.top; } if(event.pageX - this.offset.click.left > containment[2]){ pageX=containment[2] + this.offset.click.left; } if(event.pageY - this.offset.click.top > containment[3]){ pageY=containment[3] + this.offset.click.top; }} if(o.grid){ top=o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]:this.originalPageY; pageY=containment ? ((top - this.offset.click.top >=containment[1]||top - this.offset.click.top > containment[3]) ? top:((top - this.offset.click.top >=containment[1]) ? top - o.grid[1]:top + o.grid[1])):top; left=o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]:this.originalPageX; pageX=containment ? ((left - this.offset.click.left >=containment[0]||left - this.offset.click.left > containment[2]) ? left:((left - this.offset.click.left >=containment[0]) ? left - o.grid[0]:left + o.grid[0])):left; } if(o.axis==="y"){ pageX=this.originalPageX; } if(o.axis==="x"){ pageY=this.originalPageY; }} return { top: ( pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition==="fixed" ? -this.offset.scroll.top:(scrollIsRootNode ? 0:this.offset.scroll.top)) ), left: ( pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition==="fixed" ? -this.offset.scroll.left:(scrollIsRootNode ? 0:this.offset.scroll.left)) ) };}, _clear: function(){ this.helper.removeClass("ui-draggable-dragging"); if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){ this.helper.remove(); } this.helper=null; this.cancelHelperRemoval=false; if(this.destroyOnClear){ this.destroy(); }}, _normalizeRightBottom: function(){ if(this.options.axis!=="y"&&this.helper.css("right")!=="auto"){ this.helper.width(this.helper.width()); this.helper.css("right", "auto"); } if(this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"){ this.helper.height(this.helper.height()); this.helper.css("bottom", "auto"); }}, _trigger: function(type, event, ui){ ui=ui||this._uiHash(); $.ui.plugin.call(this, type, [ event, ui, this ], true); if(/^(drag|start|stop)/.test(type)){ this.positionAbs=this._convertPositionTo("absolute"); ui.offset=this.positionAbs; } return $.Widget.prototype._trigger.call(this, type, event, ui); }, plugins: {}, _uiHash: function(){ return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs };}}); $.ui.plugin.add("draggable", "connectToSortable", { start: function(event, ui, draggable){ var uiSortable=$.extend({}, ui, { item: draggable.element }); draggable.sortables=[]; $(draggable.options.connectToSortable).each(function(){ var sortable=$(this).sortable("instance"); if(sortable&&!sortable.options.disabled){ draggable.sortables.push(sortable); sortable.refreshPositions(); sortable._trigger("activate", event, uiSortable); }}); }, stop: function(event, ui, draggable){ var uiSortable=$.extend({}, ui, { item: draggable.element }); draggable.cancelHelperRemoval=false; $.each(draggable.sortables, function(){ var sortable=this; if(sortable.isOver){ sortable.isOver=0; draggable.cancelHelperRemoval=true; sortable.cancelHelperRemoval=false; sortable._storedCSS={ position: sortable.placeholder.css("position"), top: sortable.placeholder.css("top"), left: sortable.placeholder.css("left") }; sortable._mouseStop(event); sortable.options.helper=sortable.options._helper; }else{ sortable.cancelHelperRemoval=true; sortable._trigger("deactivate", event, uiSortable); }}); }, drag: function(event, ui, draggable){ $.each(draggable.sortables, function(){ var innermostIntersecting=false, sortable=this; sortable.positionAbs=draggable.positionAbs; sortable.helperProportions=draggable.helperProportions; sortable.offset.click=draggable.offset.click; if(sortable._intersectsWith(sortable.containerCache)){ innermostIntersecting=true; $.each(draggable.sortables, function(){ this.positionAbs=draggable.positionAbs; this.helperProportions=draggable.helperProportions; this.offset.click=draggable.offset.click; if(this!==sortable && this._intersectsWith(this.containerCache) && $.contains(sortable.element[ 0 ], this.element[ 0 ])){ innermostIntersecting=false; } return innermostIntersecting; }); } if(innermostIntersecting){ if(!sortable.isOver){ sortable.isOver=1; draggable._parent=ui.helper.parent(); sortable.currentItem=ui.helper .appendTo(sortable.element) .data("ui-sortable-item", true); sortable.options._helper=sortable.options.helper; sortable.options.helper=function(){ return ui.helper[ 0 ]; }; event.target=sortable.currentItem[ 0 ]; sortable._mouseCapture(event, true); sortable._mouseStart(event, true, true); sortable.offset.click.top=draggable.offset.click.top; sortable.offset.click.left=draggable.offset.click.left; sortable.offset.parent.left -=draggable.offset.parent.left - sortable.offset.parent.left; sortable.offset.parent.top -=draggable.offset.parent.top - sortable.offset.parent.top; draggable._trigger("toSortable", event); draggable.dropped=sortable.element; $.each(draggable.sortables, function(){ this.refreshPositions(); }); draggable.currentItem=draggable.element; sortable.fromOutside=draggable; } if(sortable.currentItem){ sortable._mouseDrag(event); ui.position=sortable.position; }}else{ if(sortable.isOver){ sortable.isOver=0; sortable.cancelHelperRemoval=true; sortable.options._revert=sortable.options.revert; sortable.options.revert=false; sortable._trigger("out", event, sortable._uiHash(sortable)); sortable._mouseStop(event, true); sortable.options.revert=sortable.options._revert; sortable.options.helper=sortable.options._helper; if(sortable.placeholder){ sortable.placeholder.remove(); } ui.helper.appendTo(draggable._parent); draggable._refreshOffsets(event); ui.position=draggable._generatePosition(event, true); draggable._trigger("fromSortable", event); draggable.dropped=false; $.each(draggable.sortables, function(){ this.refreshPositions(); }); }} }); }}); $.ui.plugin.add("draggable", "cursor", { start: function(event, ui, instance){ var t=$("body"), o=instance.options; if(t.css("cursor")){ o._cursor=t.css("cursor"); } t.css("cursor", o.cursor); }, stop: function(event, ui, instance){ var o=instance.options; if(o._cursor){ $("body").css("cursor", o._cursor); }} }); $.ui.plugin.add("draggable", "opacity", { start: function(event, ui, instance){ var t=$(ui.helper), o=instance.options; if(t.css("opacity")){ o._opacity=t.css("opacity"); } t.css("opacity", o.opacity); }, stop: function(event, ui, instance){ var o=instance.options; if(o._opacity){ $(ui.helper).css("opacity", o._opacity); }} }); $.ui.plugin.add("draggable", "scroll", { start: function(event, ui, i){ if(!i.scrollParentNotHidden){ i.scrollParentNotHidden=i.helper.scrollParent(false); } if(i.scrollParentNotHidden[ 0 ]!==i.document[ 0 ]&&i.scrollParentNotHidden[ 0 ].tagName!=="HTML"){ i.overflowOffset=i.scrollParentNotHidden.offset(); }}, drag: function(event, ui, i){ var o=i.options, scrolled=false, scrollParent=i.scrollParentNotHidden[ 0 ], document=i.document[ 0 ]; if(scrollParent!==document&&scrollParent.tagName!=="HTML"){ if(!o.axis||o.axis!=="x"){ if(( i.overflowOffset.top + scrollParent.offsetHeight) - event.pageY < o.scrollSensitivity){ scrollParent.scrollTop=scrolled=scrollParent.scrollTop + o.scrollSpeed; }else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity){ scrollParent.scrollTop=scrolled=scrollParent.scrollTop - o.scrollSpeed; }} if(!o.axis||o.axis!=="y"){ if(( i.overflowOffset.left + scrollParent.offsetWidth) - event.pageX < o.scrollSensitivity){ scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft + o.scrollSpeed; }else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity){ scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft - o.scrollSpeed; }} }else{ if(!o.axis||o.axis!=="x"){ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity){ scrolled=$(document).scrollTop($(document).scrollTop() - o.scrollSpeed); }else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity){ scrolled=$(document).scrollTop($(document).scrollTop() + o.scrollSpeed); }} if(!o.axis||o.axis!=="y"){ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity){ scrolled=$(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); }else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity){ scrolled=$(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); }} } if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){ $.ui.ddmanager.prepareOffsets(i, event); }} }); $.ui.plugin.add("draggable", "snap", { start: function(event, ui, i){ var o=i.options; i.snapElements=[]; $(o.snap.constructor!==String ?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){ var $t=$(this), $o=$t.offset(); if(this!==i.element[0]){ i.snapElements.push({ item: this, width: $t.outerWidth(), height: $t.outerHeight(), top: $o.top, left: $o.left }); }}); }, drag: function(event, ui, inst){ var ts, bs, ls, rs, l, r, t, b, i, first, o=inst.options, d=o.snapTolerance, x1=ui.offset.left, x2=x1 + inst.helperProportions.width, y1=ui.offset.top, y2=y1 + inst.helperProportions.height; for (i=inst.snapElements.length - 1; i >=0; i--){ l=inst.snapElements[i].left - inst.margins.left; r=l + inst.snapElements[i].width; t=inst.snapElements[i].top - inst.margins.top; b=t + inst.snapElements[i].height; if(x2 < l - d||x1 > r + d||y2 < t - d||y1 > b + d||!$.contains(inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item)){ if(inst.snapElements[i].snapping){ (inst.options.snap.release&&inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); } inst.snapElements[i].snapping=false; continue; } if(o.snapMode!=="inner"){ ts=Math.abs(t - y2) <=d; bs=Math.abs(b - y1) <=d; ls=Math.abs(l - x2) <=d; rs=Math.abs(r - x1) <=d; if(ts){ ui.position.top=inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top; } if(bs){ ui.position.top=inst._convertPositionTo("relative", { top: b, left: 0 }).top; } if(ls){ ui.position.left=inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left; } if(rs){ ui.position.left=inst._convertPositionTo("relative", { top: 0, left: r }).left; }} first=(ts||bs||ls||rs); if(o.snapMode!=="outer"){ ts=Math.abs(t - y1) <=d; bs=Math.abs(b - y2) <=d; ls=Math.abs(l - x1) <=d; rs=Math.abs(r - x2) <=d; if(ts){ ui.position.top=inst._convertPositionTo("relative", { top: t, left: 0 }).top; } if(bs){ ui.position.top=inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top; } if(ls){ ui.position.left=inst._convertPositionTo("relative", { top: 0, left: l }).left; } if(rs){ ui.position.left=inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left; }} if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){ (inst.options.snap.snap&&inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); } inst.snapElements[i].snapping=(ts||bs||ls||rs||first); }} }); $.ui.plugin.add("draggable", "stack", { start: function(event, ui, instance){ var min, o=instance.options, group=$.makeArray($(o.stack)).sort(function(a, b){ return (parseInt($(a).css("zIndex"), 10)||0) - (parseInt($(b).css("zIndex"), 10)||0); }); if(!group.length){ return; } min=parseInt($(group[0]).css("zIndex"), 10)||0; $(group).each(function(i){ $(this).css("zIndex", min + i); }); this.css("zIndex", (min + group.length)); }}); $.ui.plugin.add("draggable", "zIndex", { start: function(event, ui, instance){ var t=$(ui.helper), o=instance.options; if(t.css("zIndex")){ o._zIndex=t.css("zIndex"); } t.css("zIndex", o.zIndex); }, stop: function(event, ui, instance){ var o=instance.options; if(o._zIndex){ $(ui.helper).css("zIndex", o._zIndex); }} }); var draggable=$.ui.draggable; $.widget("ui.resizable", $.ui.mouse, { version: "1.11.4", widgetEventPrefix: "resize", options: { alsoResize: false, animate: false, animateDuration: "slow", animateEasing: "swing", aspectRatio: false, autoHide: false, containment: false, ghost: false, grid: false, handles: "e,s,se", helper: false, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 90, resize: null, start: null, stop: null }, _num: function(value){ return parseInt(value, 10)||0; }, _isNumber: function(value){ return !isNaN(parseInt(value, 10)); }, _hasScroll: function(el, a){ if($(el).css("overflow")==="hidden"){ return false; } var scroll=(a&&a==="left") ? "scrollLeft":"scrollTop", has=false; if(el[ scroll ] > 0){ return true; } el[ scroll ]=1; has=(el[ scroll ] > 0); el[ scroll ]=0; return has; }, _create: function(){ var n, i, handle, axis, hname, that=this, o=this.options; this.element.addClass("ui-resizable"); $.extend(this, { _aspectRatio: !!(o.aspectRatio), aspectRatio: o.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: o.helper||o.ghost||o.animate ? o.helper||"ui-resizable-helper":null }); if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){ this.element.wrap($("
").css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left") }) ); this.element=this.element.parent().data("ui-resizable", this.element.resizable("instance") ); this.elementIsWrapper=true; this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }); this.originalResizeStyle=this.originalElement.css("resize"); this.originalElement.css("resize", "none"); this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })); this.originalElement.css({ margin: this.originalElement.css("margin") }); this._proportionallyResize(); } this.handles=o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se":{ n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" }); this._handles=$(); if(this.handles.constructor===String){ if(this.handles==="all"){ this.handles="n,e,s,w,se,sw,ne,nw"; } n=this.handles.split(","); this.handles={}; for (i=0; i < n.length; i++){ handle=$.trim(n[i]); hname="ui-resizable-" + handle; axis=$("
"); axis.css({ zIndex: o.zIndex }); if("se"===handle){ axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"); } this.handles[handle]=".ui-resizable-" + handle; this.element.append(axis); }} this._renderAxis=function(target){ var i, axis, padPos, padWrapper; target=target||this.element; for (i in this.handles){ if(this.handles[i].constructor===String){ this.handles[i]=this.element.children(this.handles[ i ]).first().show(); }else if(this.handles[ i ].jquery||this.handles[ i ].nodeType){ this.handles[ i ]=$(this.handles[ i ]); this._on(this.handles[ i ], { "mousedown": that._mouseDown }); } if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){ axis=$(this.handles[i], this.element); padWrapper=/sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight():axis.outerWidth(); padPos=[ "padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right":"Left" ].join(""); target.css(padPos, padWrapper); this._proportionallyResize(); } this._handles=this._handles.add(this.handles[ i ]); }}; this._renderAxis(this.element); this._handles=this._handles.add(this.element.find(".ui-resizable-handle")); this._handles.disableSelection(); this._handles.mouseover(function(){ if(!that.resizing){ if(this.className){ axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); } that.axis=axis&&axis[1] ? axis[1]:"se"; }}); if(o.autoHide){ this._handles.hide(); $(this.element) .addClass("ui-resizable-autohide") .mouseenter(function(){ if(o.disabled){ return; } $(this).removeClass("ui-resizable-autohide"); that._handles.show(); }) .mouseleave(function(){ if(o.disabled){ return; } if(!that.resizing){ $(this).addClass("ui-resizable-autohide"); that._handles.hide(); }}); } this._mouseInit(); }, _destroy: function(){ this._mouseDestroy(); var wrapper, _destroy=function(exp){ $(exp) .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") .removeData("resizable") .removeData("ui-resizable") .unbind(".resizable") .find(".ui-resizable-handle") .remove(); }; if(this.elementIsWrapper){ _destroy(this.element); wrapper=this.element; this.originalElement.css({ position: wrapper.css("position"), width: wrapper.outerWidth(), height: wrapper.outerHeight(), top: wrapper.css("top"), left: wrapper.css("left") }).insertAfter(wrapper); wrapper.remove(); } this.originalElement.css("resize", this.originalResizeStyle); _destroy(this.originalElement); return this; }, _mouseCapture: function(event){ var i, handle, capture=false; for (i in this.handles){ handle=$(this.handles[i])[0]; if(handle===event.target||$.contains(handle, event.target)){ capture=true; }} return !this.options.disabled&&capture; }, _mouseStart: function(event){ var curleft, curtop, cursor, o=this.options, el=this.element; this.resizing=true; this._renderProxy(); curleft=this._num(this.helper.css("left")); curtop=this._num(this.helper.css("top")); if(o.containment){ curleft +=$(o.containment).scrollLeft()||0; curtop +=$(o.containment).scrollTop()||0; } this.offset=this.helper.offset(); this.position={ left: curleft, top: curtop }; this.size=this._helper ? { width: this.helper.width(), height: this.helper.height() }:{ width: el.width(), height: el.height() }; this.originalSize=this._helper ? { width: el.outerWidth(), height: el.outerHeight() }:{ width: el.width(), height: el.height() }; this.sizeDiff={ width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; this.originalPosition={ left: curleft, top: curtop }; this.originalMousePosition={ left: event.pageX, top: event.pageY }; this.aspectRatio=(typeof o.aspectRatio==="number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height)||1); cursor=$(".ui-resizable-" + this.axis).css("cursor"); $("body").css("cursor", cursor==="auto" ? this.axis + "-resize":cursor); el.addClass("ui-resizable-resizing"); this._propagate("start", event); return true; }, _mouseDrag: function(event){ var data, props, smp=this.originalMousePosition, a=this.axis, dx=(event.pageX - smp.left)||0, dy=(event.pageY - smp.top)||0, trigger=this._change[a]; this._updatePrevProperties(); if(!trigger){ return false; } data=trigger.apply(this, [ event, dx, dy ]); this._updateVirtualBoundaries(event.shiftKey); if(this._aspectRatio||event.shiftKey){ data=this._updateRatio(data, event); } data=this._respectSize(data, event); this._updateCache(data); this._propagate("resize", event); props=this._applyChanges(); if(!this._helper&&this._proportionallyResizeElements.length){ this._proportionallyResize(); } if(!$.isEmptyObject(props)){ this._updatePrevProperties(); this._trigger("resize", event, this.ui()); this._applyChanges(); } return false; }, _mouseStop: function(event){ this.resizing=false; var pr, ista, soffseth, soffsetw, s, left, top, o=this.options, that=this; if(this._helper){ pr=this._proportionallyResizeElements; ista=pr.length&&(/textarea/i).test(pr[0].nodeName); soffseth=ista&&this._hasScroll(pr[0], "left") ? 0:that.sizeDiff.height; soffsetw=ista ? 0:that.sizeDiff.width; s={ width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) }; left=(parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left))||null; top=(parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top))||null; if(!o.animate){ this.element.css($.extend(s, { top: top, left: left })); } that.helper.height(that.size.height); that.helper.width(that.size.width); if(this._helper&&!o.animate){ this._proportionallyResize(); }} $("body").css("cursor", "auto"); this.element.removeClass("ui-resizable-resizing"); this._propagate("stop", event); if(this._helper){ this.helper.remove(); } return false; }, _updatePrevProperties: function(){ this.prevPosition={ top: this.position.top, left: this.position.left }; this.prevSize={ width: this.size.width, height: this.size.height };}, _applyChanges: function(){ var props={}; if(this.position.top!==this.prevPosition.top){ props.top=this.position.top + "px"; } if(this.position.left!==this.prevPosition.left){ props.left=this.position.left + "px"; } if(this.size.width!==this.prevSize.width){ props.width=this.size.width + "px"; } if(this.size.height!==this.prevSize.height){ props.height=this.size.height + "px"; } this.helper.css(props); return props; }, _updateVirtualBoundaries: function(forceAspectRatio){ var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, o=this.options; b={ minWidth: this._isNumber(o.minWidth) ? o.minWidth:0, maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth:Infinity, minHeight: this._isNumber(o.minHeight) ? o.minHeight:0, maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight:Infinity }; if(this._aspectRatio||forceAspectRatio){ pMinWidth=b.minHeight * this.aspectRatio; pMinHeight=b.minWidth / this.aspectRatio; pMaxWidth=b.maxHeight * this.aspectRatio; pMaxHeight=b.maxWidth / this.aspectRatio; if(pMinWidth > b.minWidth){ b.minWidth=pMinWidth; } if(pMinHeight > b.minHeight){ b.minHeight=pMinHeight; } if(pMaxWidth < b.maxWidth){ b.maxWidth=pMaxWidth; } if(pMaxHeight < b.maxHeight){ b.maxHeight=pMaxHeight; }} this._vBoundaries=b; }, _updateCache: function(data){ this.offset=this.helper.offset(); if(this._isNumber(data.left)){ this.position.left=data.left; } if(this._isNumber(data.top)){ this.position.top=data.top; } if(this._isNumber(data.height)){ this.size.height=data.height; } if(this._isNumber(data.width)){ this.size.width=data.width; }}, _updateRatio: function(data){ var cpos=this.position, csize=this.size, a=this.axis; if(this._isNumber(data.height)){ data.width=(data.height * this.aspectRatio); }else if(this._isNumber(data.width)){ data.height=(data.width / this.aspectRatio); } if(a==="sw"){ data.left=cpos.left + (csize.width - data.width); data.top=null; } if(a==="nw"){ data.top=cpos.top + (csize.height - data.height); data.left=cpos.left + (csize.width - data.width); } return data; }, _respectSize: function(data){ var o=this._vBoundaries, a=this.axis, ismaxw=this._isNumber(data.width)&&o.maxWidth&&(o.maxWidth < data.width), ismaxh=this._isNumber(data.height)&&o.maxHeight&&(o.maxHeight < data.height), isminw=this._isNumber(data.width)&&o.minWidth&&(o.minWidth > data.width), isminh=this._isNumber(data.height)&&o.minHeight&&(o.minHeight > data.height), dw=this.originalPosition.left + this.originalSize.width, dh=this.position.top + this.size.height, cw=/sw|nw|w/.test(a), ch=/nw|ne|n/.test(a); if(isminw){ data.width=o.minWidth; } if(isminh){ data.height=o.minHeight; } if(ismaxw){ data.width=o.maxWidth; } if(ismaxh){ data.height=o.maxHeight; } if(isminw&&cw){ data.left=dw - o.minWidth; } if(ismaxw&&cw){ data.left=dw - o.maxWidth; } if(isminh&&ch){ data.top=dh - o.minHeight; } if(ismaxh&&ch){ data.top=dh - o.maxHeight; } if(!data.width&&!data.height&&!data.left&&data.top){ data.top=null; }else if(!data.width&&!data.height&&!data.top&&data.left){ data.left=null; } return data; }, _getPaddingPlusBorderDimensions: function(element){ var i=0, widths=[], borders=[ element.css("borderTopWidth"), element.css("borderRightWidth"), element.css("borderBottomWidth"), element.css("borderLeftWidth") ], paddings=[ element.css("paddingTop"), element.css("paddingRight"), element.css("paddingBottom"), element.css("paddingLeft") ]; for(; i < 4; i++){ widths[ i ]=(parseInt(borders[ i ], 10)||0); widths[ i ] +=(parseInt(paddings[ i ], 10)||0); } return { height: widths[ 0 ] + widths[ 2 ], width: widths[ 1 ] + widths[ 3 ] };}, _proportionallyResize: function(){ if(!this._proportionallyResizeElements.length){ return; } var prel, i=0, element=this.helper||this.element; for(; i < this._proportionallyResizeElements.length; i++){ prel=this._proportionallyResizeElements[i]; if(!this.outerDimensions){ this.outerDimensions=this._getPaddingPlusBorderDimensions(prel); } prel.css({ height: (element.height() - this.outerDimensions.height)||0, width: (element.width() - this.outerDimensions.width)||0 }); }}, _renderProxy: function(){ var el=this.element, o=this.options; this.elementOffset=el.offset(); if(this._helper){ this.helper=this.helper||$("
"); this.helper.addClass(this._helper).css({ width: this.element.outerWidth() - 1, height: this.element.outerHeight() - 1, position: "absolute", left: this.elementOffset.left + "px", top: this.elementOffset.top + "px", zIndex: ++o.zIndex }); this.helper .appendTo("body") .disableSelection(); }else{ this.helper=this.element; }}, _change: { e: function(event, dx){ return { width: this.originalSize.width + dx };}, w: function(event, dx){ var cs=this.originalSize, sp=this.originalPosition; return { left: sp.left + dx, width: cs.width - dx };}, n: function(event, dx, dy){ var cs=this.originalSize, sp=this.originalPosition; return { top: sp.top + dy, height: cs.height - dy };}, s: function(event, dx, dy){ return { height: this.originalSize.height + dy };}, se: function(event, dx, dy){ return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [ event, dx, dy ])); }, sw: function(event, dx, dy){ return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [ event, dx, dy ])); }, ne: function(event, dx, dy){ return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [ event, dx, dy ])); }, nw: function(event, dx, dy){ return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [ event, dx, dy ])); }}, _propagate: function(n, event){ $.ui.plugin.call(this, n, [ event, this.ui() ]); (n!=="resize"&&this._trigger(n, event, this.ui())); }, plugins: {}, ui: function(){ return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition };}}); $.ui.plugin.add("resizable", "animate", { stop: function(event){ var that=$(this).resizable("instance"), o=that.options, pr=that._proportionallyResizeElements, ista=pr.length&&(/textarea/i).test(pr[0].nodeName), soffseth=ista&&that._hasScroll(pr[0], "left") ? 0:that.sizeDiff.height, soffsetw=ista ? 0:that.sizeDiff.width, style={ width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, left=(parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left))||null, top=(parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top))||null; that.element.animate($.extend(style, top&&left ? { top: top, left: left }:{}), { duration: o.animateDuration, easing: o.animateEasing, step: function(){ var data={ width: parseInt(that.element.css("width"), 10), height: parseInt(that.element.css("height"), 10), top: parseInt(that.element.css("top"), 10), left: parseInt(that.element.css("left"), 10) }; if(pr&&pr.length){ $(pr[0]).css({ width: data.width, height: data.height }); } that._updateCache(data); that._propagate("resize", event); }} ); }}); $.ui.plugin.add("resizable", "containment", { start: function(){ var element, p, co, ch, cw, width, height, that=$(this).resizable("instance"), o=that.options, el=that.element, oc=o.containment, ce=(oc instanceof $) ? oc.get(0):(/parent/.test(oc)) ? el.parent().get(0):oc; if(!ce){ return; } that.containerElement=$(ce); if(/document/.test(oc)||oc===document){ that.containerOffset={ left: 0, top: 0 }; that.containerPosition={ left: 0, top: 0 }; that.parentData={ element: $(document), left: 0, top: 0, width: $(document).width(), height: $(document).height()||document.body.parentNode.scrollHeight };}else{ element=$(ce); p=[]; $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name){ p[ i ]=that._num(element.css("padding" + name)); }); that.containerOffset=element.offset(); that.containerPosition=element.position(); that.containerSize={ height:(element.innerHeight() - p[ 3 ]), width:(element.innerWidth() - p[ 1 ]) }; co=that.containerOffset; ch=that.containerSize.height; cw=that.containerSize.width; width=(that._hasScroll(ce, "left") ? ce.scrollWidth:cw); height=(that._hasScroll(ce) ? ce.scrollHeight:ch) ; that.parentData={ element: ce, left: co.left, top: co.top, width: width, height: height };}}, resize: function(event){ var woset, hoset, isParent, isOffsetRelative, that=$(this).resizable("instance"), o=that.options, co=that.containerOffset, cp=that.position, pRatio=that._aspectRatio||event.shiftKey, cop={ top: 0, left: 0 }, ce=that.containerElement, continueResize=true; if(ce[ 0 ]!==document&&(/static/).test(ce.css("position"))){ cop=co; } if(cp.left <(that._helper ? co.left:0)){ that.size.width=that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); if(pRatio){ that.size.height=that.size.width / that.aspectRatio; continueResize=false; } that.position.left=o.helper ? co.left:0; } if(cp.top <(that._helper ? co.top:0)){ that.size.height=that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); if(pRatio){ that.size.width=that.size.height * that.aspectRatio; continueResize=false; } that.position.top=that._helper ? co.top:0; } isParent=that.containerElement.get(0)===that.element.parent().get(0); isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position")); if(isParent&&isOffsetRelative){ that.offset.left=that.parentData.left + that.position.left; that.offset.top=that.parentData.top + that.position.top; }else{ that.offset.left=that.element.offset().left; that.offset.top=that.element.offset().top; } woset=Math.abs(that.sizeDiff.width + (that._helper ? that.offset.left - cop.left : (that.offset.left - co.left))); hoset=Math.abs(that.sizeDiff.height + (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top))); if(woset + that.size.width >=that.parentData.width){ that.size.width=that.parentData.width - woset; if(pRatio){ that.size.height=that.size.width / that.aspectRatio; continueResize=false; }} if(hoset + that.size.height >=that.parentData.height){ that.size.height=that.parentData.height - hoset; if(pRatio){ that.size.width=that.size.height * that.aspectRatio; continueResize=false; }} if(!continueResize){ that.position.left=that.prevPosition.left; that.position.top=that.prevPosition.top; that.size.width=that.prevSize.width; that.size.height=that.prevSize.height; }}, stop: function(){ var that=$(this).resizable("instance"), o=that.options, co=that.containerOffset, cop=that.containerPosition, ce=that.containerElement, helper=$(that.helper), ho=helper.offset(), w=helper.outerWidth() - that.sizeDiff.width, h=helper.outerHeight() - that.sizeDiff.height; if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); } if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); }} }); $.ui.plugin.add("resizable", "alsoResize", { start: function(){ var that=$(this).resizable("instance"), o=that.options; $(o.alsoResize).each(function(){ var el=$(this); el.data("ui-resizable-alsoresize", { width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10) }); }); }, resize: function(event, ui){ var that=$(this).resizable("instance"), o=that.options, os=that.originalSize, op=that.originalPosition, delta={ height: (that.size.height - os.height)||0, width: (that.size.width - os.width)||0, top: (that.position.top - op.top)||0, left: (that.position.left - op.left)||0 }; $(o.alsoResize).each(function(){ var el=$(this), start=$(this).data("ui-resizable-alsoresize"), style={}, css=el.parents(ui.originalElement[0]).length ? [ "width", "height" ] : [ "width", "height", "top", "left" ]; $.each(css, function(i, prop){ var sum=(start[prop]||0) + (delta[prop]||0); if(sum&&sum >=0){ style[prop]=sum||null; }}); el.css(style); }); }, stop: function(){ $(this).removeData("resizable-alsoresize"); }}); $.ui.plugin.add("resizable", "ghost", { start: function(){ var that=$(this).resizable("instance"), o=that.options, cs=that.size; that.ghost=that.originalElement.clone(); that.ghost .css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) .addClass("ui-resizable-ghost") .addClass(typeof o.ghost==="string" ? o.ghost:""); that.ghost.appendTo(that.helper); }, resize: function(){ var that=$(this).resizable("instance"); if(that.ghost){ that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width }); }}, stop: function(){ var that=$(this).resizable("instance"); if(that.ghost&&that.helper){ that.helper.get(0).removeChild(that.ghost.get(0)); }} }); $.ui.plugin.add("resizable", "grid", { resize: function(){ var outerDimensions, that=$(this).resizable("instance"), o=that.options, cs=that.size, os=that.originalSize, op=that.originalPosition, a=that.axis, grid=typeof o.grid==="number" ? [ o.grid, o.grid ]:o.grid, gridX=(grid[0]||1), gridY=(grid[1]||1), ox=Math.round((cs.width - os.width) / gridX) * gridX, oy=Math.round((cs.height - os.height) / gridY) * gridY, newWidth=os.width + ox, newHeight=os.height + oy, isMaxWidth=o.maxWidth&&(o.maxWidth < newWidth), isMaxHeight=o.maxHeight&&(o.maxHeight < newHeight), isMinWidth=o.minWidth&&(o.minWidth > newWidth), isMinHeight=o.minHeight&&(o.minHeight > newHeight); o.grid=grid; if(isMinWidth){ newWidth +=gridX; } if(isMinHeight){ newHeight +=gridY; } if(isMaxWidth){ newWidth -=gridX; } if(isMaxHeight){ newHeight -=gridY; } if(/^(se|s|e)$/.test(a)){ that.size.width=newWidth; that.size.height=newHeight; }else if(/^(ne)$/.test(a)){ that.size.width=newWidth; that.size.height=newHeight; that.position.top=op.top - oy; }else if(/^(sw)$/.test(a)){ that.size.width=newWidth; that.size.height=newHeight; that.position.left=op.left - ox; }else{ if(newHeight - gridY <=0||newWidth - gridX <=0){ outerDimensions=that._getPaddingPlusBorderDimensions(this); } if(newHeight - gridY > 0){ that.size.height=newHeight; that.position.top=op.top - oy; }else{ newHeight=gridY - outerDimensions.height; that.size.height=newHeight; that.position.top=op.top + os.height - newHeight; } if(newWidth - gridX > 0){ that.size.width=newWidth; that.position.left=op.left - ox; }else{ newWidth=gridX - outerDimensions.width; that.size.width=newWidth; that.position.left=op.left + os.width - newWidth; }} }}); var resizable=$.ui.resizable; var dialog=$.widget("ui.dialog", { version: "1.11.4", options: { appendTo: "body", autoOpen: true, buttons: [], closeOnEscape: true, closeText: "Close", dialogClass: "", draggable: true, hide: null, height: "auto", maxHeight: null, maxWidth: null, minHeight: 150, minWidth: 150, modal: false, position: { my: "center", at: "center", of: window, collision: "fit", using: function(pos){ var topOffset=$(this).css(pos).offset().top; if(topOffset < 0){ $(this).css("top", pos.top - topOffset); }} }, resizable: true, show: null, title: null, width: 300, beforeClose: null, close: null, drag: null, dragStart: null, dragStop: null, focus: null, open: null, resize: null, resizeStart: null, resizeStop: null }, sizeRelatedOptions: { buttons: true, height: true, maxHeight: true, maxWidth: true, minHeight: true, minWidth: true, width: true }, resizableRelatedOptions: { maxHeight: true, maxWidth: true, minHeight: true, minWidth: true }, _create: function(){ this.originalCss={ display: this.element[ 0 ].style.display, width: this.element[ 0 ].style.width, minHeight: this.element[ 0 ].style.minHeight, maxHeight: this.element[ 0 ].style.maxHeight, height: this.element[ 0 ].style.height }; this.originalPosition={ parent: this.element.parent(), index: this.element.parent().children().index(this.element) }; this.originalTitle=this.element.attr("title"); this.options.title=this.options.title||this.originalTitle; this._createWrapper(); this.element .show() .removeAttr("title") .addClass("ui-dialog-content ui-widget-content") .appendTo(this.uiDialog); this._createTitlebar(); this._createButtonPane(); if(this.options.draggable&&$.fn.draggable){ this._makeDraggable(); } if(this.options.resizable&&$.fn.resizable){ this._makeResizable(); } this._isOpen=false; this._trackFocus(); }, _init: function(){ if(this.options.autoOpen){ this.open(); }}, _appendTo: function(){ var element=this.options.appendTo; if(element&&(element.jquery||element.nodeType)){ return $(element); } return this.document.find(element||"body").eq(0); }, _destroy: function(){ var next, originalPosition=this.originalPosition; this._untrackInstance(); this._destroyOverlay(); this.element .removeUniqueId() .removeClass("ui-dialog-content ui-widget-content") .css(this.originalCss) .detach(); this.uiDialog.stop(true, true).remove(); if(this.originalTitle){ this.element.attr("title", this.originalTitle); } next=originalPosition.parent.children().eq(originalPosition.index); if(next.length&&next[ 0 ]!==this.element[ 0 ]){ next.before(this.element); }else{ originalPosition.parent.append(this.element); }}, widget: function(){ return this.uiDialog; }, disable: $.noop, enable: $.noop, close: function(event){ var activeElement, that=this; if(!this._isOpen||this._trigger("beforeClose", event)===false){ return; } this._isOpen=false; this._focusedElement=null; this._destroyOverlay(); this._untrackInstance(); if(!this.opener.filter(":focusable").focus().length){ try { activeElement=this.document[ 0 ].activeElement; if(activeElement&&activeElement.nodeName.toLowerCase()!=="body"){ $(activeElement).blur(); }} catch(error){}} this._hide(this.uiDialog, this.options.hide, function(){ that._trigger("close", event); }); }, isOpen: function(){ return this._isOpen; }, moveToTop: function(){ this._moveToTop(); }, _moveToTop: function(event, silent){ var moved=false, zIndices=this.uiDialog.siblings(".ui-front:visible").map(function(){ return +$(this).css("z-index"); }).get(), zIndexMax=Math.max.apply(null, zIndices); if(zIndexMax >=+this.uiDialog.css("z-index")){ this.uiDialog.css("z-index", zIndexMax + 1); moved=true; } if(moved&&!silent){ this._trigger("focus", event); } return moved; }, open: function(){ var that=this; if(this._isOpen){ if(this._moveToTop()){ this._focusTabbable(); } return; } this._isOpen=true; this.opener=$(this.document[ 0 ].activeElement); this._size(); this._position(); this._createOverlay(); this._moveToTop(null, true); if(this.overlay){ this.overlay.css("z-index", this.uiDialog.css("z-index") - 1); } this._show(this.uiDialog, this.options.show, function(){ that._focusTabbable(); that._trigger("focus"); }); this._makeFocusTarget(); this._trigger("open"); }, _focusTabbable: function(){ var hasFocus=this._focusedElement; if(!hasFocus){ hasFocus=this.element.find("[autofocus]"); } if(!hasFocus.length){ hasFocus=this.element.find(":tabbable"); } if(!hasFocus.length){ hasFocus=this.uiDialogButtonPane.find(":tabbable"); } if(!hasFocus.length){ hasFocus=this.uiDialogTitlebarClose.filter(":tabbable"); } if(!hasFocus.length){ hasFocus=this.uiDialog; } hasFocus.eq(0).focus(); }, _keepFocus: function(event){ function checkFocus(){ var activeElement=this.document[0].activeElement, isActive=this.uiDialog[0]===activeElement || $.contains(this.uiDialog[0], activeElement); if(!isActive){ this._focusTabbable(); }} event.preventDefault(); checkFocus.call(this); this._delay(checkFocus); }, _createWrapper: function(){ this.uiDialog=$("
") .addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " + this.options.dialogClass) .hide() .attr({ tabIndex: -1, role: "dialog" }) .appendTo(this._appendTo()); this._on(this.uiDialog, { keydown: function(event){ if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode && event.keyCode===$.ui.keyCode.ESCAPE){ event.preventDefault(); this.close(event); return; } if(event.keyCode!==$.ui.keyCode.TAB||event.isDefaultPrevented()){ return; } var tabbables=this.uiDialog.find(":tabbable"), first=tabbables.filter(":first"), last=tabbables.filter(":last"); if(( event.target===last[0]||event.target===this.uiDialog[0])&&!event.shiftKey){ this._delay(function(){ first.focus(); }); event.preventDefault(); }else if(( event.target===first[0]||event.target===this.uiDialog[0])&&event.shiftKey){ this._delay(function(){ last.focus(); }); event.preventDefault(); }}, mousedown: function(event){ if(this._moveToTop(event)){ this._focusTabbable(); }} }); if(!this.element.find("[aria-describedby]").length){ this.uiDialog.attr({ "aria-describedby": this.element.uniqueId().attr("id") }); }}, _createTitlebar: function(){ var uiDialogTitle; this.uiDialogTitlebar=$("
") .addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix") .prependTo(this.uiDialog); this._on(this.uiDialogTitlebar, { mousedown: function(event){ if(!$(event.target).closest(".ui-dialog-titlebar-close")){ this.uiDialog.focus(); }} }); this.uiDialogTitlebarClose=$("") .button({ label: this.options.closeText, icons: { primary: "ui-icon-closethick" }, text: false }) .addClass("ui-dialog-titlebar-close") .appendTo(this.uiDialogTitlebar); this._on(this.uiDialogTitlebarClose, { click: function(event){ event.preventDefault(); this.close(event); }}); uiDialogTitle=$("") .uniqueId() .addClass("ui-dialog-title") .prependTo(this.uiDialogTitlebar); this._title(uiDialogTitle); this.uiDialog.attr({ "aria-labelledby": uiDialogTitle.attr("id") }); }, _title: function(title){ if(!this.options.title){ title.html(" "); } title.text(this.options.title); }, _createButtonPane: function(){ this.uiDialogButtonPane=$("
") .addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"); this.uiButtonSet=$("
") .addClass("ui-dialog-buttonset") .appendTo(this.uiDialogButtonPane); this._createButtons(); }, _createButtons: function(){ var that=this, buttons=this.options.buttons; this.uiDialogButtonPane.remove(); this.uiButtonSet.empty(); if($.isEmptyObject(buttons)||($.isArray(buttons)&&!buttons.length)){ this.uiDialog.removeClass("ui-dialog-buttons"); return; } $.each(buttons, function(name, props){ var click, buttonOptions; props=$.isFunction(props) ? { click: props, text: name } : props; props=$.extend({ type: "button" }, props); click=props.click; props.click=function(){ click.apply(that.element[ 0 ], arguments); }; buttonOptions={ icons: props.icons, text: props.showText }; delete props.icons; delete props.showText; $("", props) .button(buttonOptions) .appendTo(that.uiButtonSet); }); this.uiDialog.addClass("ui-dialog-buttons"); this.uiDialogButtonPane.appendTo(this.uiDialog); }, _makeDraggable: function(){ var that=this, options=this.options; function filteredUi(ui){ return { position: ui.position, offset: ui.offset };} this.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function(event, ui){ $(this).addClass("ui-dialog-dragging"); that._blockFrames(); that._trigger("dragStart", event, filteredUi(ui)); }, drag: function(event, ui){ that._trigger("drag", event, filteredUi(ui)); }, stop: function(event, ui){ var left=ui.offset.left - that.document.scrollLeft(), top=ui.offset.top - that.document.scrollTop(); options.position={ my: "left top", at: "left" + (left >=0 ? "+":"") + left + " " + "top" + (top >=0 ? "+":"") + top, of: that.window }; $(this).removeClass("ui-dialog-dragging"); that._unblockFrames(); that._trigger("dragStop", event, filteredUi(ui)); }}); }, _makeResizable: function(){ var that=this, options=this.options, handles=options.resizable, position=this.uiDialog.css("position"), resizeHandles=typeof handles==="string" ? handles : "n,e,s,w,se,sw,ne,nw"; function filteredUi(ui){ return { originalPosition: ui.originalPosition, originalSize: ui.originalSize, position: ui.position, size: ui.size };} this.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: this.element, maxWidth: options.maxWidth, maxHeight: options.maxHeight, minWidth: options.minWidth, minHeight: this._minHeight(), handles: resizeHandles, start: function(event, ui){ $(this).addClass("ui-dialog-resizing"); that._blockFrames(); that._trigger("resizeStart", event, filteredUi(ui)); }, resize: function(event, ui){ that._trigger("resize", event, filteredUi(ui)); }, stop: function(event, ui){ var offset=that.uiDialog.offset(), left=offset.left - that.document.scrollLeft(), top=offset.top - that.document.scrollTop(); options.height=that.uiDialog.height(); options.width=that.uiDialog.width(); options.position={ my: "left top", at: "left" + (left >=0 ? "+":"") + left + " " + "top" + (top >=0 ? "+":"") + top, of: that.window }; $(this).removeClass("ui-dialog-resizing"); that._unblockFrames(); that._trigger("resizeStop", event, filteredUi(ui)); }}) .css("position", position); }, _trackFocus: function(){ this._on(this.widget(), { focusin: function(event){ this._makeFocusTarget(); this._focusedElement=$(event.target); }}); }, _makeFocusTarget: function(){ this._untrackInstance(); this._trackingInstances().unshift(this); }, _untrackInstance: function(){ var instances=this._trackingInstances(), exists=$.inArray(this, instances); if(exists!==-1){ instances.splice(exists, 1); }}, _trackingInstances: function(){ var instances=this.document.data("ui-dialog-instances"); if(!instances){ instances=[]; this.document.data("ui-dialog-instances", instances); } return instances; }, _minHeight: function(){ var options=this.options; return options.height==="auto" ? options.minHeight : Math.min(options.minHeight, options.height); }, _position: function(){ var isVisible=this.uiDialog.is(":visible"); if(!isVisible){ this.uiDialog.show(); } this.uiDialog.position(this.options.position); if(!isVisible){ this.uiDialog.hide(); }}, _setOptions: function(options){ var that=this, resize=false, resizableOptions={}; $.each(options, function(key, value){ that._setOption(key, value); if(key in that.sizeRelatedOptions){ resize=true; } if(key in that.resizableRelatedOptions){ resizableOptions[ key ]=value; }}); if(resize){ this._size(); this._position(); } if(this.uiDialog.is(":data(ui-resizable)")){ this.uiDialog.resizable("option", resizableOptions); }}, _setOption: function(key, value){ var isDraggable, isResizable, uiDialog=this.uiDialog; if(key==="dialogClass"){ uiDialog .removeClass(this.options.dialogClass) .addClass(value); } if(key==="disabled"){ return; } this._super(key, value); if(key==="appendTo"){ this.uiDialog.appendTo(this._appendTo()); } if(key==="buttons"){ this._createButtons(); } if(key==="closeText"){ this.uiDialogTitlebarClose.button({ label: "" + value }); } if(key==="draggable"){ isDraggable=uiDialog.is(":data(ui-draggable)"); if(isDraggable&&!value){ uiDialog.draggable("destroy"); } if(!isDraggable&&value){ this._makeDraggable(); }} if(key==="position"){ this._position(); } if(key==="resizable"){ isResizable=uiDialog.is(":data(ui-resizable)"); if(isResizable&&!value){ uiDialog.resizable("destroy"); } if(isResizable&&typeof value==="string"){ uiDialog.resizable("option", "handles", value); } if(!isResizable&&value!==false){ this._makeResizable(); }} if(key==="title"){ this._title(this.uiDialogTitlebar.find(".ui-dialog-title")); }}, _size: function(){ var nonContentHeight, minContentHeight, maxContentHeight, options=this.options; this.element.show().css({ width: "auto", minHeight: 0, maxHeight: "none", height: 0 }); if(options.minWidth > options.width){ options.width=options.minWidth; } nonContentHeight=this.uiDialog.css({ height: "auto", width: options.width }) .outerHeight(); minContentHeight=Math.max(0, options.minHeight - nonContentHeight); maxContentHeight=typeof options.maxHeight==="number" ? Math.max(0, options.maxHeight - nonContentHeight) : "none"; if(options.height==="auto"){ this.element.css({ minHeight: minContentHeight, maxHeight: maxContentHeight, height: "auto" }); }else{ this.element.height(Math.max(0, options.height - nonContentHeight)); } if(this.uiDialog.is(":data(ui-resizable)")){ this.uiDialog.resizable("option", "minHeight", this._minHeight()); }}, _blockFrames: function(){ this.iframeBlocks=this.document.find("iframe").map(function(){ var iframe=$(this); return $("
") .css({ position: "absolute", width: iframe.outerWidth(), height: iframe.outerHeight() }) .appendTo(iframe.parent()) .offset(iframe.offset())[0]; }); }, _unblockFrames: function(){ if(this.iframeBlocks){ this.iframeBlocks.remove(); delete this.iframeBlocks; }}, _allowInteraction: function(event){ if($(event.target).closest(".ui-dialog").length){ return true; } return !!$(event.target).closest(".ui-datepicker").length; }, _createOverlay: function(){ if(!this.options.modal){ return; } var isOpening=true; this._delay(function(){ isOpening=false; }); if(!this.document.data("ui-dialog-overlays")){ this._on(this.document, { focusin: function(event){ if(isOpening){ return; } if(!this._allowInteraction(event)){ event.preventDefault(); this._trackingInstances()[ 0 ]._focusTabbable(); }} }); } this.overlay=$("
") .addClass("ui-widget-overlay ui-front") .appendTo(this._appendTo()); this._on(this.overlay, { mousedown: "_keepFocus" }); this.document.data("ui-dialog-overlays", (this.document.data("ui-dialog-overlays")||0) + 1); }, _destroyOverlay: function(){ if(!this.options.modal){ return; } if(this.overlay){ var overlays=this.document.data("ui-dialog-overlays") - 1; if(!overlays){ this.document .unbind("focusin") .removeData("ui-dialog-overlays"); }else{ this.document.data("ui-dialog-overlays", overlays); } this.overlay.remove(); this.overlay=null; }} }); $.widget("ui.droppable", { version: "1.11.4", widgetEventPrefix: "drop", options: { accept: "*", activeClass: false, addClasses: true, greedy: false, hoverClass: false, scope: "default", tolerance: "intersect", activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function(){ var proportions, o=this.options, accept=o.accept; this.isover=false; this.isout=true; this.accept=$.isFunction(accept) ? accept:function(d){ return d.is(accept); }; this.proportions=function(){ if(arguments.length){ proportions=arguments[ 0 ]; }else{ return proportions ? proportions : proportions={ width: this.element[ 0 ].offsetWidth, height: this.element[ 0 ].offsetHeight };}}; this._addToManager(o.scope); o.addClasses&&this.element.addClass("ui-droppable"); }, _addToManager: function(scope){ $.ui.ddmanager.droppables[ scope ]=$.ui.ddmanager.droppables[ scope ]||[]; $.ui.ddmanager.droppables[ scope ].push(this); }, _splice: function(drop){ var i=0; for(; i < drop.length; i++){ if(drop[ i ]===this){ drop.splice(i, 1); }} }, _destroy: function(){ var drop=$.ui.ddmanager.droppables[ this.options.scope ]; this._splice(drop); this.element.removeClass("ui-droppable ui-droppable-disabled"); }, _setOption: function(key, value){ if(key==="accept"){ this.accept=$.isFunction(value) ? value:function(d){ return d.is(value); };}else if(key==="scope"){ var drop=$.ui.ddmanager.droppables[ this.options.scope ]; this._splice(drop); this._addToManager(value); } this._super(key, value); }, _activate: function(event){ var draggable=$.ui.ddmanager.current; if(this.options.activeClass){ this.element.addClass(this.options.activeClass); } if(draggable){ this._trigger("activate", event, this.ui(draggable)); }}, _deactivate: function(event){ var draggable=$.ui.ddmanager.current; if(this.options.activeClass){ this.element.removeClass(this.options.activeClass); } if(draggable){ this._trigger("deactivate", event, this.ui(draggable)); }}, _over: function(event){ var draggable=$.ui.ddmanager.current; if(!draggable||(draggable.currentItem||draggable.element)[ 0 ]===this.element[ 0 ]){ return; } if(this.accept.call(this.element[ 0 ],(draggable.currentItem||draggable.element))){ if(this.options.hoverClass){ this.element.addClass(this.options.hoverClass); } this._trigger("over", event, this.ui(draggable)); }}, _out: function(event){ var draggable=$.ui.ddmanager.current; if(!draggable||(draggable.currentItem||draggable.element)[ 0 ]===this.element[ 0 ]){ return; } if(this.accept.call(this.element[ 0 ],(draggable.currentItem||draggable.element))){ if(this.options.hoverClass){ this.element.removeClass(this.options.hoverClass); } this._trigger("out", event, this.ui(draggable)); }}, _drop: function(event, custom){ var draggable=custom||$.ui.ddmanager.current, childrenIntersection=false; if(!draggable||(draggable.currentItem||draggable.element)[ 0 ]===this.element[ 0 ]){ return false; } this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){ var inst=$(this).droppable("instance"); if(inst.options.greedy && !inst.options.disabled && inst.options.scope===draggable.options.scope && inst.accept.call(inst.element[ 0 ],(draggable.currentItem||draggable.element)) && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance, event) ){ childrenIntersection=true; return false; }}); if(childrenIntersection){ return false; } if(this.accept.call(this.element[ 0 ],(draggable.currentItem||draggable.element))){ if(this.options.activeClass){ this.element.removeClass(this.options.activeClass); } if(this.options.hoverClass){ this.element.removeClass(this.options.hoverClass); } this._trigger("drop", event, this.ui(draggable)); return this.element; } return false; }, ui: function(c){ return { draggable:(c.currentItem||c.element), helper: c.helper, position: c.position, offset: c.positionAbs };}}); $.ui.intersect=(function(){ function isOverAxis(x, reference, size){ return(x >=reference)&&(x <(reference + size)); } return function(draggable, droppable, toleranceMode, event){ if(!droppable.offset){ return false; } var x1=(draggable.positionAbs||draggable.position.absolute).left + draggable.margins.left, y1=(draggable.positionAbs||draggable.position.absolute).top + draggable.margins.top, x2=x1 + draggable.helperProportions.width, y2=y1 + draggable.helperProportions.height, l=droppable.offset.left, t=droppable.offset.top, r=l + droppable.proportions().width, b=t + droppable.proportions().height; switch(toleranceMode){ case "fit": return(l <=x1&&x2 <=r&&t <=y1&&y2 <=b); case "intersect": return(l < x1 +(draggable.helperProportions.width / 2) && x2 -(draggable.helperProportions.width / 2) < r && t < y1 +(draggable.helperProportions.height / 2) && y2 -(draggable.helperProportions.height / 2) < b); case "pointer": return isOverAxis(event.pageY, t, droppable.proportions().height)&&isOverAxis(event.pageX, l, droppable.proportions().width); case "touch": return ( (y1 >=t&&y1 <=b) || (y2 >=t&&y2 <=b) || (y1 < t&&y2 > b) )&&( (x1 >=l&&x1 <=r) || (x2 >=l&&x2 <=r) || (x1 < l&&x2 > r) ); default: return false; }};})(); $.ui.ddmanager={ current: null, droppables: { "default": [] }, prepareOffsets: function(t, event){ var i, j, m=$.ui.ddmanager.droppables[ t.options.scope ]||[], type=event ? event.type:null, list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack(); droppablesLoop: for(i=0; i < m.length; i++){ if(m[ i ].options.disabled||(t&&!m[ i ].accept.call(m[ i ].element[ 0 ],(t.currentItem||t.element)))){ continue; } for(j=0; j < list.length; j++){ if(list[ j ]===m[ i ].element[ 0 ]){ m[ i ].proportions().height=0; continue droppablesLoop; }} m[ i ].visible=m[ i ].element.css("display")!=="none"; if(!m[ i ].visible){ continue; } if(type==="mousedown"){ m[ i ]._activate.call(m[ i ], event); } m[ i ].offset=m[ i ].element.offset(); m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight }); }}, drop: function(draggable, event){ var dropped=false; $.each(( $.ui.ddmanager.droppables[ draggable.options.scope ]||[]).slice(), function(){ if(!this.options){ return; } if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable, this, this.options.tolerance, event)){ dropped=this._drop.call(this, event)||dropped; } if(!this.options.disabled&&this.visible&&this.accept.call(this.element[ 0 ],(draggable.currentItem||draggable.element))){ this.isout=true; this.isover=false; this._deactivate.call(this, event); }}); return dropped; }, dragStart: function(draggable, event){ draggable.element.parentsUntil("body").bind("scroll.droppable", function(){ if(!draggable.options.refreshPositions){ $.ui.ddmanager.prepareOffsets(draggable, event); }}); }, drag: function(draggable, event){ if(draggable.options.refreshPositions){ $.ui.ddmanager.prepareOffsets(draggable, event); } $.each($.ui.ddmanager.droppables[ draggable.options.scope ]||[], function(){ if(this.options.disabled||this.greedyChild||!this.visible){ return; } var parentInstance, scope, parent, intersects=$.ui.intersect(draggable, this, this.options.tolerance, event), c = !intersects&&this.isover ? "isout":(intersects&&!this.isover ? "isover":null); if(!c){ return; } if(this.options.greedy){ scope=this.options.scope; parent=this.element.parents(":data(ui-droppable)").filter(function(){ return $(this).droppable("instance").options.scope===scope; }); if(parent.length){ parentInstance=$(parent[ 0 ]).droppable("instance"); parentInstance.greedyChild=(c==="isover"); }} if(parentInstance&&c==="isover"){ parentInstance.isover=false; parentInstance.isout=true; parentInstance._out.call(parentInstance, event); } this[ c ]=true; this[c==="isout" ? "isover":"isout"]=false; this[c==="isover" ? "_over":"_out"].call(this, event); if(parentInstance&&c==="isout"){ parentInstance.isout=false; parentInstance.isover=true; parentInstance._over.call(parentInstance, event); }}); }, dragStop: function(draggable, event){ draggable.element.parentsUntil("body").unbind("scroll.droppable"); if(!draggable.options.refreshPositions){ $.ui.ddmanager.prepareOffsets(draggable, event); }} }; var droppable=$.ui.droppable; var dataSpace="ui-effects-", jQuery=$; $.effects={ effect: {}}; (function(jQuery, undefined){ var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", rplusequals=/^([\-+])=\s*(\d+\.?\d*)/, stringParsers=[ { re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function(execResult){ return [ execResult[ 1 ], execResult[ 2 ], execResult[ 3 ], execResult[ 4 ] ]; }}, { re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function(execResult){ return [ execResult[ 1 ] * 2.55, execResult[ 2 ] * 2.55, execResult[ 3 ] * 2.55, execResult[ 4 ] ]; }}, { re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function(execResult){ return [ parseInt(execResult[ 1 ], 16), parseInt(execResult[ 2 ], 16), parseInt(execResult[ 3 ], 16) ]; }}, { re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function(execResult){ return [ parseInt(execResult[ 1 ] + execResult[ 1 ], 16), parseInt(execResult[ 2 ] + execResult[ 2 ], 16), parseInt(execResult[ 3 ] + execResult[ 3 ], 16) ]; }}, { re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, space: "hsla", parse: function(execResult){ return [ execResult[ 1 ], execResult[ 2 ] / 100, execResult[ 3 ] / 100, execResult[ 4 ] ]; }} ], color=jQuery.Color=function(color, green, blue, alpha){ return new jQuery.Color.fn.parse(color, green, blue, alpha); }, spaces={ rgba: { props: { red: { idx: 0, type: "byte" }, green: { idx: 1, type: "byte" }, blue: { idx: 2, type: "byte" }} }, hsla: { props: { hue: { idx: 0, type: "degrees" }, saturation: { idx: 1, type: "percent" }, lightness: { idx: 2, type: "percent" }} }}, propTypes={ "byte": { floor: true, max: 255 }, "percent": { max: 1 }, "degrees": { mod: 360, floor: true }}, support=color.support={}, supportElem=jQuery("

")[ 0 ], colors, each=jQuery.each; supportElem.style.cssText="background-color:rgba(1,1,1,.5)"; support.rgba=supportElem.style.backgroundColor.indexOf("rgba") > -1; each(spaces, function(spaceName, space){ space.cache="_" + spaceName; space.props.alpha={ idx: 3, type: "percent", def: 1 };}); function clamp(value, prop, allowEmpty){ var type=propTypes[ prop.type ]||{}; if(value==null){ return (allowEmpty||!prop.def) ? null:prop.def; } value=type.floor ? ~~value:parseFloat(value); if(isNaN(value)){ return prop.def; } if(type.mod){ return (value + type.mod) % type.mod; } return 0 > value ? 0:type.max < value ? type.max:value; } function stringParse(string){ var inst=color(), rgba=inst._rgba=[]; string=string.toLowerCase(); each(stringParsers, function(i, parser){ var parsed, match=parser.re.exec(string), values=match&&parser.parse(match), spaceName=parser.space||"rgba"; if(values){ parsed=inst[ spaceName ](values); inst[ spaces[ spaceName ].cache ]=parsed[ spaces[ spaceName ].cache ]; rgba=inst._rgba=parsed._rgba; return false; }}); if(rgba.length){ if(rgba.join()==="0,0,0,0"){ jQuery.extend(rgba, colors.transparent); } return inst; } return colors[ string ]; } color.fn=jQuery.extend(color.prototype, { parse: function(red, green, blue, alpha){ if(red===undefined){ this._rgba=[ null, null, null, null ]; return this; } if(red.jquery||red.nodeType){ red=jQuery(red).css(green); green=undefined; } var inst=this, type=jQuery.type(red), rgba=this._rgba=[]; if(green!==undefined){ red=[ red, green, blue, alpha ]; type="array"; } if(type==="string"){ return this.parse(stringParse(red)||colors._default); } if(type==="array"){ each(spaces.rgba.props, function(key, prop){ rgba[ prop.idx ]=clamp(red[ prop.idx ], prop); }); return this; } if(type==="object"){ if(red instanceof color){ each(spaces, function(spaceName, space){ if(red[ space.cache ]){ inst[ space.cache ]=red[ space.cache ].slice(); }}); }else{ each(spaces, function(spaceName, space){ var cache=space.cache; each(space.props, function(key, prop){ if(!inst[ cache ]&&space.to){ if(key==="alpha"||red[ key ]==null){ return; } inst[ cache ]=space.to(inst._rgba); } inst[ cache ][ prop.idx ]=clamp(red[ key ], prop, true); }); if(inst[ cache ]&&jQuery.inArray(null, inst[ cache ].slice(0, 3)) < 0){ inst[ cache ][ 3 ]=1; if(space.from){ inst._rgba=space.from(inst[ cache ]); }} }); } return this; }}, is: function(compare){ var is=color(compare), same=true, inst=this; each(spaces, function(_, space){ var localCache, isCache=is[ space.cache ]; if(isCache){ localCache=inst[ space.cache ]||space.to&&space.to(inst._rgba)||[]; each(space.props, function(_, prop){ if(isCache[ prop.idx ]!=null){ same=(isCache[ prop.idx ]===localCache[ prop.idx ]); return same; }}); } return same; }); return same; }, _space: function(){ var used=[], inst=this; each(spaces, function(spaceName, space){ if(inst[ space.cache ]){ used.push(spaceName); }}); return used.pop(); }, transition: function(other, distance){ var end=color(other), spaceName=end._space(), space=spaces[ spaceName ], startColor=this.alpha()===0 ? color("transparent"):this, start=startColor[ space.cache ]||space.to(startColor._rgba), result=start.slice(); end=end[ space.cache ]; each(space.props, function(key, prop){ var index=prop.idx, startValue=start[ index ], endValue=end[ index ], type=propTypes[ prop.type ]||{}; if(endValue===null){ return; } if(startValue===null){ result[ index ]=endValue; }else{ if(type.mod){ if(endValue - startValue > type.mod / 2){ startValue +=type.mod; }else if(startValue - endValue > type.mod / 2){ startValue -=type.mod; }} result[ index ]=clamp(( endValue - startValue) * distance + startValue, prop); }}); return this[ spaceName ](result); }, blend: function(opaque){ if(this._rgba[ 3 ]===1){ return this; } var rgb=this._rgba.slice(), a=rgb.pop(), blend=color(opaque)._rgba; return color(jQuery.map(rgb, function(v, i){ return(1 - a) * blend[ i ] + a * v; })); }, toRgbaString: function(){ var prefix="rgba(", rgba=jQuery.map(this._rgba, function(v, i){ return v==null ?(i > 2 ? 1:0):v; }); if(rgba[ 3 ]===1){ rgba.pop(); prefix="rgb("; } return prefix + rgba.join() + ")"; }, toHslaString: function(){ var prefix="hsla(", hsla=jQuery.map(this.hsla(), function(v, i){ if(v==null){ v=i > 2 ? 1:0; } if(i&&i < 3){ v=Math.round(v * 100) + "%"; } return v; }); if(hsla[ 3 ]===1){ hsla.pop(); prefix="hsl("; } return prefix + hsla.join() + ")"; }, toHexString: function(includeAlpha){ var rgba=this._rgba.slice(), alpha=rgba.pop(); if(includeAlpha){ rgba.push(~~(alpha * 255)); } return "#" + jQuery.map(rgba, function(v){ v=(v||0).toString(16); return v.length===1 ? "0" + v:v; }).join(""); }, toString: function(){ return this._rgba[ 3 ]===0 ? "transparent":this.toRgbaString(); }}); color.fn.parse.prototype=color.fn; function hue2rgb(p, q, h){ h=(h + 1) % 1; if(h * 6 < 1){ return p +(q - p) * h * 6; } if(h * 2 < 1){ return q; } if(h * 3 < 2){ return p +(q - p) *(( 2 / 3) - h) * 6; } return p; } spaces.hsla.to=function(rgba){ if(rgba[ 0 ]==null||rgba[ 1 ]==null||rgba[ 2 ]==null){ return [ null, null, null, rgba[ 3 ] ]; } var r=rgba[ 0 ] / 255, g=rgba[ 1 ] / 255, b=rgba[ 2 ] / 255, a=rgba[ 3 ], max=Math.max(r, g, b), min=Math.min(r, g, b), diff=max - min, add=max + min, l=add * 0.5, h, s; if(min===max){ h=0; }else if(r===max){ h=(60 *(g - b) / diff) + 360; }else if(g===max){ h=(60 *(b - r) / diff) + 120; }else{ h=(60 *(r - g) / diff) + 240; } if(diff===0){ s=0; }else if(l <=0.5){ s=diff / add; }else{ s=diff /(2 - add); } return [ Math.round(h) % 360, s, l, a==null ? 1:a ]; }; spaces.hsla.from=function(hsla){ if(hsla[ 0 ]==null||hsla[ 1 ]==null||hsla[ 2 ]==null){ return [ null, null, null, hsla[ 3 ] ]; } var h=hsla[ 0 ] / 360, s=hsla[ 1 ], l=hsla[ 2 ], a=hsla[ 3 ], q=l <=0.5 ? l *(1 + s):l + s - l * s, p=2 * l - q; return [ Math.round(hue2rgb(p, q, h +(1 / 3)) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h -(1 / 3)) * 255), a ]; }; each(spaces, function(spaceName, space){ var props=space.props, cache=space.cache, to=space.to, from=space.from; color.fn[ spaceName ]=function(value){ if(to&&!this[ cache ]){ this[ cache ]=to(this._rgba); } if(value===undefined){ return this[ cache ].slice(); } var ret, type=jQuery.type(value), arr=(type==="array"||type==="object") ? value:arguments, local=this[ cache ].slice(); each(props, function(key, prop){ var val=arr[ type==="object" ? key:prop.idx ]; if(val==null){ val=local[ prop.idx ]; } local[ prop.idx ]=clamp(val, prop); }); if(from){ ret=color(from(local)); ret[ cache ]=local; return ret; }else{ return color(local); }}; each(props, function(key, prop){ if(color.fn[ key ]){ return; } color.fn[ key ]=function(value){ var vtype=jQuery.type(value), fn=(key==="alpha" ?(this._hsla ? "hsla":"rgba"):spaceName), local=this[ fn ](), cur=local[ prop.idx ], match; if(vtype==="undefined"){ return cur; } if(vtype==="function"){ value=value.call(this, cur); vtype=jQuery.type(value); } if(value==null&&prop.empty){ return this; } if(vtype==="string"){ match=rplusequals.exec(value); if(match){ value=cur + parseFloat(match[ 2 ]) *(match[ 1 ]==="+" ? 1:-1); }} local[ prop.idx ]=value; return this[ fn ](local); };}); }); color.hook=function(hook){ var hooks=hook.split(" "); each(hooks, function(i, hook){ jQuery.cssHooks[ hook ]={ set: function(elem, value){ var parsed, curElem, backgroundColor=""; if(value!=="transparent"&&(jQuery.type(value)!=="string"||(parsed=stringParse(value)))){ value=color(parsed||value); if(!support.rgba&&value._rgba[ 3 ]!==1){ curElem=hook==="backgroundColor" ? elem.parentNode:elem; while ( (backgroundColor===""||backgroundColor==="transparent") && curElem&&curElem.style ){ try { backgroundColor=jQuery.css(curElem, "backgroundColor"); curElem=curElem.parentNode; } catch(e){ }} value=value.blend(backgroundColor&&backgroundColor!=="transparent" ? backgroundColor : "_default"); } value=value.toRgbaString(); } try { elem.style[ hook ]=value; } catch(e){ }} }; jQuery.fx.step[ hook ]=function(fx){ if(!fx.colorInit){ fx.start=color(fx.elem, hook); fx.end=color(fx.end); fx.colorInit=true; } jQuery.cssHooks[ hook ].set(fx.elem, fx.start.transition(fx.end, fx.pos)); };}); }; color.hook(stepHooks); jQuery.cssHooks.borderColor={ expand: function(value){ var expanded={}; each([ "Top", "Right", "Bottom", "Left" ], function(i, part){ expanded[ "border" + part + "Color" ]=value; }); return expanded; }}; colors=jQuery.Color.names={ aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [ null, null, null, 0 ], _default: "#ffffff" };})(jQuery); (function(){ var classAnimationActions=[ "add", "remove", "toggle" ], shorthandStyles={ border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function(_, prop){ $.fx.step[ prop ]=function(fx){ if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){ jQuery.style(fx.elem, prop, fx.end); fx.setAttr=true; }};}); function getElementStyles(elem){ var key, len, style=elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle, styles={}; if(style&&style.length&&style[ 0 ]&&style[ style[ 0 ] ]){ len=style.length; while(len--){ key=style[ len ]; if(typeof style[ key ]==="string"){ styles[ $.camelCase(key) ]=style[ key ]; }} }else{ for(key in style){ if(typeof style[ key ]==="string"){ styles[ key ]=style[ key ]; }} } return styles; } function styleDifference(oldStyle, newStyle){ var diff={}, name, value; for(name in newStyle){ value=newStyle[ name ]; if(oldStyle[ name ]!==value){ if(!shorthandStyles[ name ]){ if($.fx.step[ name ]||!isNaN(parseFloat(value))){ diff[ name ]=value; }} }} return diff; } if(!$.fn.addBack){ $.fn.addBack=function(selector){ return this.add(selector==null ? this.prevObject:this.prevObject.filter(selector) ); };} $.effects.animateClass=function(value, duration, easing, callback){ var o=$.speed(duration, easing, callback); return this.queue(function(){ var animated=$(this), baseClass=animated.attr("class")||"", applyClassChange, allAnimations=o.children ? animated.find("*").addBack():animated; allAnimations=allAnimations.map(function(){ var el=$(this); return { el: el, start: getElementStyles(this) };}); applyClassChange=function(){ $.each(classAnimationActions, function(i, action){ if(value[ action ]){ animated[ action + "Class" ](value[ action ]); }}); }; applyClassChange(); allAnimations=allAnimations.map(function(){ this.end=getElementStyles(this.el[ 0 ]); this.diff=styleDifference(this.start, this.end); return this; }); animated.attr("class", baseClass); allAnimations=allAnimations.map(function(){ var styleInfo=this, dfd=$.Deferred(), opts=$.extend({}, o, { queue: false, complete: function(){ dfd.resolve(styleInfo); }}); this.el.animate(this.diff, opts); return dfd.promise(); }); $.when.apply($, allAnimations.get()).done(function(){ applyClassChange(); $.each(arguments, function(){ var el=this.el; $.each(this.diff, function(key){ el.css(key, ""); }); }); o.complete.call(animated[ 0 ]); }); }); }; $.fn.extend({ addClass: (function(orig){ return function(classNames, speed, easing, callback){ return speed ? $.effects.animateClass.call(this, { add: classNames }, speed, easing, callback) : orig.apply(this, arguments); };})($.fn.addClass), removeClass: (function(orig){ return function(classNames, speed, easing, callback){ return arguments.length > 1 ? $.effects.animateClass.call(this, { remove: classNames }, speed, easing, callback) : orig.apply(this, arguments); };})($.fn.removeClass), toggleClass: (function(orig){ return function(classNames, force, speed, easing, callback){ if(typeof force==="boolean"||force===undefined){ if(!speed){ return orig.apply(this, arguments); }else{ return $.effects.animateClass.call(this, (force ? { add: classNames }:{ remove: classNames }), speed, easing, callback); }}else{ return $.effects.animateClass.call(this, { toggle: classNames }, force, speed, easing); }};})($.fn.toggleClass), switchClass: function(remove, add, speed, easing, callback){ return $.effects.animateClass.call(this, { add: add, remove: remove }, speed, easing, callback); }}); })(); (function(){ $.extend($.effects, { version: "1.11.4", save: function(element, set){ for(var i=0; i < set.length; i++){ if(set[ i ]!==null){ element.data(dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ]); }} }, restore: function(element, set){ var val, i; for(i=0; i < set.length; i++){ if(set[ i ]!==null){ val=element.data(dataSpace + set[ i ]); if(val===undefined){ val=""; } element.css(set[ i ], val); }} }, setMode: function(el, mode){ if(mode==="toggle"){ mode=el.is(":hidden") ? "show":"hide"; } return mode; }, getBaseline: function(origin, original){ var y, x; switch(origin[ 0 ]){ case "top": y=0; break; case "middle": y=0.5; break; case "bottom": y=1; break; default: y=origin[ 0 ] / original.height; } switch(origin[ 1 ]){ case "left": x=0; break; case "center": x=0.5; break; case "right": x=1; break; default: x=origin[ 1 ] / original.width; } return { x: x, y: y };}, createWrapper: function(element){ if(element.parent().is(".ui-effects-wrapper")){ return element.parent(); } var props={ width: element.outerWidth(true), height: element.outerHeight(true), "float": element.css("float") }, wrapper=$("

") .addClass("ui-effects-wrapper") .css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), size={ width: element.width(), height: element.height() }, active=document.activeElement; try { active.id; } catch(e){ active=document.body; } element.wrap(wrapper); if(element[ 0 ]===active||$.contains(element[ 0 ], active)){ $(active).focus(); } wrapper=element.parent(); if(element.css("position")==="static"){ wrapper.css({ position: "relative" }); element.css({ position: "relative" }); }else{ $.extend(props, { position: element.css("position"), zIndex: element.css("z-index") }); $.each([ "top", "left", "bottom", "right" ], function(i, pos){ props[ pos ]=element.css(pos); if(isNaN(parseInt(props[ pos ], 10))){ props[ pos ]="auto"; }}); element.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" }); } element.css(size); return wrapper.css(props).show(); }, removeWrapper: function(element){ var active=document.activeElement; if(element.parent().is(".ui-effects-wrapper")){ element.parent().replaceWith(element); if(element[ 0 ]===active||$.contains(element[ 0 ], active)){ $(active).focus(); }} return element; }, setTransition: function(element, list, factor, value){ value=value||{}; $.each(list, function(i, x){ var unit=element.cssUnit(x); if(unit[ 0 ] > 0){ value[ x ]=unit[ 0 ] * factor + unit[ 1 ]; }}); return value; }}); function _normalizeArguments(effect, options, speed, callback){ if($.isPlainObject(effect)){ options=effect; effect=effect.effect; } effect={ effect: effect }; if(options==null){ options={};} if($.isFunction(options)){ callback=options; speed=null; options={};} if(typeof options==="number"||$.fx.speeds[ options ]){ callback=speed; speed=options; options={};} if($.isFunction(speed)){ callback=speed; speed=null; } if(options){ $.extend(effect, options); } speed=speed||options.duration; effect.duration=$.fx.off ? 0 : typeof speed==="number" ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default; effect.complete=callback||options.complete; return effect; } function standardAnimationOption(option){ if(!option||typeof option==="number"||$.fx.speeds[ option ]){ return true; } if(typeof option==="string"&&!$.effects.effect[ option ]){ return true; } if($.isFunction(option)){ return true; } if(typeof option==="object"&&!option.effect){ return true; } return false; } $.fn.extend({ effect: function(){ var args=_normalizeArguments.apply(this, arguments), mode=args.mode, queue=args.queue, effectMethod=$.effects.effect[ args.effect ]; if($.fx.off||!effectMethod){ if(mode){ return this[ mode ](args.duration, args.complete); }else{ return this.each(function(){ if(args.complete){ args.complete.call(this); }}); }} function run(next){ var elem=$(this), complete=args.complete, mode=args.mode; function done(){ if($.isFunction(complete)){ complete.call(elem[0]); } if($.isFunction(next)){ next(); }} if(elem.is(":hidden") ? mode==="hide":mode==="show"){ elem[ mode ](); done(); }else{ effectMethod.call(elem[0], args, done); }} return queue===false ? this.each(run):this.queue(queue||"fx", run); }, show: (function(orig){ return function(option){ if(standardAnimationOption(option)){ return orig.apply(this, arguments); }else{ var args=_normalizeArguments.apply(this, arguments); args.mode="show"; return this.effect.call(this, args); }};})($.fn.show), hide: (function(orig){ return function(option){ if(standardAnimationOption(option)){ return orig.apply(this, arguments); }else{ var args=_normalizeArguments.apply(this, arguments); args.mode="hide"; return this.effect.call(this, args); }};})($.fn.hide), toggle: (function(orig){ return function(option){ if(standardAnimationOption(option)||typeof option==="boolean"){ return orig.apply(this, arguments); }else{ var args=_normalizeArguments.apply(this, arguments); args.mode="toggle"; return this.effect.call(this, args); }};})($.fn.toggle), cssUnit: function(key){ var style=this.css(key), val=[]; $.each([ "em", "px", "%", "pt" ], function(i, unit){ if(style.indexOf(unit) > 0){ val=[ parseFloat(style), unit ]; }}); return val; }}); })(); (function(){ var baseEasings={}; $.each([ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function(i, name){ baseEasings[ name ]=function(p){ return Math.pow(p, i + 2); };}); $.extend(baseEasings, { Sine: function(p){ return 1 - Math.cos(p * Math.PI / 2); }, Circ: function(p){ return 1 - Math.sqrt(1 - p * p); }, Elastic: function(p){ return p===0||p===1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(( (p - 1) * 80 - 7.5) * Math.PI / 15); }, Back: function(p){ return p * p *(3 * p - 2); }, Bounce: function(p){ var pow2, bounce=4; while(p <(( pow2=Math.pow(2, --bounce)) - 1) / 11){} return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow(( pow2 * 3 - 2) / 22 - p, 2); }}); $.each(baseEasings, function(name, easeIn){ $.easing[ "easeIn" + name ]=easeIn; $.easing[ "easeOut" + name ]=function(p){ return 1 - easeIn(1 - p); }; $.easing[ "easeInOut" + name ]=function(p){ return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2; };}); })(); var effect=$.effects; var effectBlind=$.effects.effect.blind=function(o, done){ var el=$(this), rvertical=/up|down|vertical/, rpositivemotion=/up|left|vertical|horizontal/, props=[ "position", "top", "bottom", "left", "right", "height", "width" ], mode=$.effects.setMode(el, o.mode||"hide"), direction=o.direction||"up", vertical=rvertical.test(direction), ref=vertical ? "height":"width", ref2=vertical ? "top":"left", motion=rpositivemotion.test(direction), animation={}, show=mode==="show", wrapper, distance, margin; if(el.parent().is(".ui-effects-wrapper")){ $.effects.save(el.parent(), props); }else{ $.effects.save(el, props); } el.show(); wrapper=$.effects.createWrapper(el).css({ overflow: "hidden" }); distance=wrapper[ ref ](); margin=parseFloat(wrapper.css(ref2))||0; animation[ ref ]=show ? distance:0; if(!motion){ el .css(vertical ? "bottom":"right", 0) .css(vertical ? "top":"left", "auto") .css({ position: "absolute" }); animation[ ref2 ]=show ? margin:distance + margin; } if(show){ wrapper.css(ref, 0); if(!motion){ wrapper.css(ref2, margin + distance); }} wrapper.animate(animation, { duration: o.duration, easing: o.easing, queue: false, complete: function(){ if(mode==="hide"){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }}); }; var effectBounce=$.effects.effect.bounce=function(o, done){ var el=$(this), props=[ "position", "top", "bottom", "left", "right", "height", "width" ], mode=$.effects.setMode(el, o.mode||"effect"), hide=mode==="hide", show=mode==="show", direction=o.direction||"up", distance=o.distance, times=o.times||5, anims=times * 2 +(show||hide ? 1:0), speed=o.duration / anims, easing=o.easing, ref=(direction==="up"||direction==="down") ? "top":"left", motion=(direction==="up"||direction==="left"), i, upAnim, downAnim, queue=el.queue(), queuelen=queue.length; if(show||hide){ props.push("opacity"); } $.effects.save(el, props); el.show(); $.effects.createWrapper(el); if(!distance){ distance=el[ ref==="top" ? "outerHeight":"outerWidth" ]() / 3; } if(show){ downAnim={ opacity: 1 }; downAnim[ ref ]=0; el.css("opacity", 0) .css(ref, motion ? -distance * 2:distance * 2) .animate(downAnim, speed, easing); } if(hide){ distance=distance / Math.pow(2, times - 1); } downAnim={}; downAnim[ ref ]=0; for(i=0; i < times; i++){ upAnim={}; upAnim[ ref ]=(motion ? "-=":"+=") + distance; el.animate(upAnim, speed, easing) .animate(downAnim, speed, easing); distance=hide ? distance * 2:distance / 2; } if(hide){ upAnim={ opacity: 0 }; upAnim[ ref ]=(motion ? "-=":"+=") + distance; el.animate(upAnim, speed, easing); } el.queue(function(){ if(hide){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }); if(queuelen > 1){ queue.splice.apply(queue, [ 1, 0 ].concat(queue.splice(queuelen, anims + 1))); } el.dequeue(); }; var effectClip=$.effects.effect.clip=function(o, done){ var el=$(this), props=[ "position", "top", "bottom", "left", "right", "height", "width" ], mode=$.effects.setMode(el, o.mode||"hide"), show=mode==="show", direction=o.direction||"vertical", vert=direction==="vertical", size=vert ? "height":"width", position=vert ? "top":"left", animation={}, wrapper, animate, distance; $.effects.save(el, props); el.show(); wrapper=$.effects.createWrapper(el).css({ overflow: "hidden" }); animate=(el[0].tagName==="IMG") ? wrapper:el; distance=animate[ size ](); if(show){ animate.css(size, 0); animate.css(position, distance / 2); } animation[ size ]=show ? distance:0; animation[ position ]=show ? 0:distance / 2; animate.animate(animation, { queue: false, duration: o.duration, easing: o.easing, complete: function(){ if(!show){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }}); }; var effectDrop=$.effects.effect.drop=function(o, done){ var el=$(this), props=[ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ], mode=$.effects.setMode(el, o.mode||"hide"), show=mode==="show", direction=o.direction||"left", ref=(direction==="up"||direction==="down") ? "top":"left", motion=(direction==="up"||direction==="left") ? "pos":"neg", animation={ opacity: show ? 1:0 }, distance; $.effects.save(el, props); el.show(); $.effects.createWrapper(el); distance=o.distance||el[ ref==="top" ? "outerHeight":"outerWidth" ](true) / 2; if(show){ el .css("opacity", 0) .css(ref, motion==="pos" ? -distance:distance); } animation[ ref ]=(show ? (motion==="pos" ? "+=":"-=") : (motion==="pos" ? "-=":"+=")) + distance; el.animate(animation, { queue: false, duration: o.duration, easing: o.easing, complete: function(){ if(mode==="hide"){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }}); }; var effectExplode=$.effects.effect.explode=function(o, done){ var rows=o.pieces ? Math.round(Math.sqrt(o.pieces)):3, cells=rows, el=$(this), mode=$.effects.setMode(el, o.mode||"hide"), show=mode==="show", offset=el.show().css("visibility", "hidden").offset(), width=Math.ceil(el.outerWidth() / cells), height=Math.ceil(el.outerHeight() / rows), pieces=[], i, j, left, top, mx, my; function childComplete(){ pieces.push(this); if(pieces.length===rows * cells){ animComplete(); }} for(i=0; i < rows ; i++){ top=offset.top + i * height; my=i -(rows - 1) / 2 ; for(j=0; j < cells ; j++){ left=offset.left + j * width; mx=j -(cells - 1) / 2 ; el .clone() .appendTo("body") .wrap("
") .css({ position: "absolute", visibility: "visible", left: -j * width, top: -i * height }) .parent() .addClass("ui-effects-explode") .css({ position: "absolute", overflow: "hidden", width: width, height: height, left: left +(show ? mx * width:0), top: top +(show ? my * height:0), opacity: show ? 0:1 }).animate({ left: left +(show ? 0:mx * width), top: top +(show ? 0:my * height), opacity: show ? 1:0 }, o.duration||500, o.easing, childComplete); }} function animComplete(){ el.css({ visibility: "visible" }); $(pieces).remove(); if(!show){ el.hide(); } done(); }}; var effectFade=$.effects.effect.fade=function(o, done){ var el=$(this), mode=$.effects.setMode(el, o.mode||"toggle"); el.animate({ opacity: mode }, { queue: false, duration: o.duration, easing: o.easing, complete: done }); }; var effectFold=$.effects.effect.fold=function(o, done){ var el=$(this), props=[ "position", "top", "bottom", "left", "right", "height", "width" ], mode=$.effects.setMode(el, o.mode||"hide"), show=mode==="show", hide=mode==="hide", size=o.size||15, percent=/([0-9]+)%/.exec(size), horizFirst = !!o.horizFirst, widthFirst=show!==horizFirst, ref=widthFirst ? [ "width", "height" ]:[ "height", "width" ], duration=o.duration / 2, wrapper, distance, animation1={}, animation2={}; $.effects.save(el, props); el.show(); wrapper=$.effects.createWrapper(el).css({ overflow: "hidden" }); distance=widthFirst ? [ wrapper.width(), wrapper.height() ] : [ wrapper.height(), wrapper.width() ]; if(percent){ size=parseInt(percent[ 1 ], 10) / 100 * distance[ hide ? 0:1 ]; } if(show){ wrapper.css(horizFirst ? { height: 0, width: size }:{ height: size, width: 0 }); } animation1[ ref[ 0 ] ]=show ? distance[ 0 ]:size; animation2[ ref[ 1 ] ]=show ? distance[ 1 ]:0; wrapper .animate(animation1, duration, o.easing) .animate(animation2, duration, o.easing, function(){ if(hide){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }); }; var effectHighlight=$.effects.effect.highlight=function(o, done){ var elem=$(this), props=[ "backgroundImage", "backgroundColor", "opacity" ], mode=$.effects.setMode(elem, o.mode||"show"), animation={ backgroundColor: elem.css("backgroundColor") }; if(mode==="hide"){ animation.opacity=0; } $.effects.save(elem, props); elem .show() .css({ backgroundImage: "none", backgroundColor: o.color||"#ffff99" }) .animate(animation, { queue: false, duration: o.duration, easing: o.easing, complete: function(){ if(mode==="hide"){ elem.hide(); } $.effects.restore(elem, props); done(); }}); }; var effectSize=$.effects.effect.size=function(o, done){ var original, baseline, factor, el=$(this), props0=[ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], props1=[ "position", "top", "bottom", "left", "right", "overflow", "opacity" ], props2=[ "width", "height", "overflow" ], cProps=[ "fontSize" ], vProps=[ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], hProps=[ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], mode=$.effects.setMode(el, o.mode||"effect"), restore=o.restore||mode!=="effect", scale=o.scale||"both", origin=o.origin||[ "middle", "center" ], position=el.css("position"), props=restore ? props0:props1, zero={ height: 0, width: 0, outerHeight: 0, outerWidth: 0 }; if(mode==="show"){ el.show(); } original={ height: el.height(), width: el.width(), outerHeight: el.outerHeight(), outerWidth: el.outerWidth() }; if(o.mode==="toggle"&&mode==="show"){ el.from=o.to||zero; el.to=o.from||original; }else{ el.from=o.from||(mode==="show" ? zero:original); el.to=o.to||(mode==="hide" ? zero:original); } factor={ from: { y: el.from.height / original.height, x: el.from.width / original.width }, to: { y: el.to.height / original.height, x: el.to.width / original.width }}; if(scale==="box"||scale==="both"){ if(factor.from.y!==factor.to.y){ props=props.concat(vProps); el.from=$.effects.setTransition(el, vProps, factor.from.y, el.from); el.to=$.effects.setTransition(el, vProps, factor.to.y, el.to); } if(factor.from.x!==factor.to.x){ props=props.concat(hProps); el.from=$.effects.setTransition(el, hProps, factor.from.x, el.from); el.to=$.effects.setTransition(el, hProps, factor.to.x, el.to); }} if(scale==="content"||scale==="both"){ if(factor.from.y!==factor.to.y){ props=props.concat(cProps).concat(props2); el.from=$.effects.setTransition(el, cProps, factor.from.y, el.from); el.to=$.effects.setTransition(el, cProps, factor.to.y, el.to); }} $.effects.save(el, props); el.show(); $.effects.createWrapper(el); el.css("overflow", "hidden").css(el.from); if(origin){ baseline=$.effects.getBaseline(origin, original); el.from.top=(original.outerHeight - el.outerHeight()) * baseline.y; el.from.left=(original.outerWidth - el.outerWidth()) * baseline.x; el.to.top=(original.outerHeight - el.to.outerHeight) * baseline.y; el.to.left=(original.outerWidth - el.to.outerWidth) * baseline.x; } el.css(el.from); if(scale==="content"||scale==="both"){ vProps=vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); hProps=hProps.concat([ "marginLeft", "marginRight" ]); props2=props0.concat(vProps).concat(hProps); el.find("*[width]").each(function(){ var child=$(this), c_original={ height: child.height(), width: child.width(), outerHeight: child.outerHeight(), outerWidth: child.outerWidth() }; if(restore){ $.effects.save(child, props2); } child.from={ height: c_original.height * factor.from.y, width: c_original.width * factor.from.x, outerHeight: c_original.outerHeight * factor.from.y, outerWidth: c_original.outerWidth * factor.from.x }; child.to={ height: c_original.height * factor.to.y, width: c_original.width * factor.to.x, outerHeight: c_original.height * factor.to.y, outerWidth: c_original.width * factor.to.x }; if(factor.from.y!==factor.to.y){ child.from=$.effects.setTransition(child, vProps, factor.from.y, child.from); child.to=$.effects.setTransition(child, vProps, factor.to.y, child.to); } if(factor.from.x!==factor.to.x){ child.from=$.effects.setTransition(child, hProps, factor.from.x, child.from); child.to=$.effects.setTransition(child, hProps, factor.to.x, child.to); } child.css(child.from); child.animate(child.to, o.duration, o.easing, function(){ if(restore){ $.effects.restore(child, props2); }}); }); } el.animate(el.to, { queue: false, duration: o.duration, easing: o.easing, complete: function(){ if(el.to.opacity===0){ el.css("opacity", el.from.opacity); } if(mode==="hide"){ el.hide(); } $.effects.restore(el, props); if(!restore){ if(position==="static"){ el.css({ position: "relative", top: el.to.top, left: el.to.left }); }else{ $.each([ "top", "left" ], function(idx, pos){ el.css(pos, function(_, str){ var val=parseInt(str, 10), toRef=idx ? el.to.left:el.to.top; if(str==="auto"){ return toRef + "px"; } return val + toRef + "px"; }); }); }} $.effects.removeWrapper(el); done(); }}); }; var effectScale=$.effects.effect.scale=function(o, done){ var el=$(this), options=$.extend(true, {}, o), mode=$.effects.setMode(el, o.mode||"effect"), percent=parseInt(o.percent, 10) || (parseInt(o.percent, 10)===0 ? 0:(mode==="hide" ? 0:100)), direction=o.direction||"both", origin=o.origin, original={ height: el.height(), width: el.width(), outerHeight: el.outerHeight(), outerWidth: el.outerWidth() }, factor={ y: direction!=="horizontal" ? (percent / 100):1, x: direction!=="vertical" ? (percent / 100):1 }; options.effect="size"; options.queue=false; options.complete=done; if(mode!=="effect"){ options.origin=origin||[ "middle", "center" ]; options.restore=true; } options.from=o.from||(mode==="show" ? { height: 0, width: 0, outerHeight: 0, outerWidth: 0 }:original); options.to={ height: original.height * factor.y, width: original.width * factor.x, outerHeight: original.outerHeight * factor.y, outerWidth: original.outerWidth * factor.x }; if(options.fade){ if(mode==="show"){ options.from.opacity=0; options.to.opacity=1; } if(mode==="hide"){ options.from.opacity=1; options.to.opacity=0; }} el.effect(options); }; var effectPuff=$.effects.effect.puff=function(o, done){ var elem=$(this), mode=$.effects.setMode(elem, o.mode||"hide"), hide=mode==="hide", percent=parseInt(o.percent, 10)||150, factor=percent / 100, original={ height: elem.height(), width: elem.width(), outerHeight: elem.outerHeight(), outerWidth: elem.outerWidth() }; $.extend(o, { effect: "scale", queue: false, fade: true, mode: mode, complete: done, percent: hide ? percent:100, from: hide ? original : { height: original.height * factor, width: original.width * factor, outerHeight: original.outerHeight * factor, outerWidth: original.outerWidth * factor }}); elem.effect(o); }; var effectPulsate=$.effects.effect.pulsate=function(o, done){ var elem=$(this), mode=$.effects.setMode(elem, o.mode||"show"), show=mode==="show", hide=mode==="hide", showhide=(show||mode==="hide"), anims=(( o.times||5) * 2) +(showhide ? 1:0), duration=o.duration / anims, animateTo=0, queue=elem.queue(), queuelen=queue.length, i; if(show||!elem.is(":visible")){ elem.css("opacity", 0).show(); animateTo=1; } for(i=1; i < anims; i++){ elem.animate({ opacity: animateTo }, duration, o.easing); animateTo=1 - animateTo; } elem.animate({ opacity: animateTo }, duration, o.easing); elem.queue(function(){ if(hide){ elem.hide(); } done(); }); if(queuelen > 1){ queue.splice.apply(queue, [ 1, 0 ].concat(queue.splice(queuelen, anims + 1))); } elem.dequeue(); }; var effectShake=$.effects.effect.shake=function(o, done){ var el=$(this), props=[ "position", "top", "bottom", "left", "right", "height", "width" ], mode=$.effects.setMode(el, o.mode||"effect"), direction=o.direction||"left", distance=o.distance||20, times=o.times||3, anims=times * 2 + 1, speed=Math.round(o.duration / anims), ref=(direction==="up"||direction==="down") ? "top":"left", positiveMotion=(direction==="up"||direction==="left"), animation={}, animation1={}, animation2={}, i, queue=el.queue(), queuelen=queue.length; $.effects.save(el, props); el.show(); $.effects.createWrapper(el); animation[ ref ]=(positiveMotion ? "-=":"+=") + distance; animation1[ ref ]=(positiveMotion ? "+=":"-=") + distance * 2; animation2[ ref ]=(positiveMotion ? "-=":"+=") + distance * 2; el.animate(animation, speed, o.easing); for(i=1; i < times; i++){ el.animate(animation1, speed, o.easing).animate(animation2, speed, o.easing); } el .animate(animation1, speed, o.easing) .animate(animation, speed / 2, o.easing) .queue(function(){ if(mode==="hide"){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }); if(queuelen > 1){ queue.splice.apply(queue, [ 1, 0 ].concat(queue.splice(queuelen, anims + 1))); } el.dequeue(); }; var effectSlide=$.effects.effect.slide=function(o, done){ var el=$(this), props=[ "position", "top", "bottom", "left", "right", "width", "height" ], mode=$.effects.setMode(el, o.mode||"show"), show=mode==="show", direction=o.direction||"left", ref=(direction==="up"||direction==="down") ? "top":"left", positiveMotion=(direction==="up"||direction==="left"), distance, animation={}; $.effects.save(el, props); el.show(); distance=o.distance||el[ ref==="top" ? "outerHeight":"outerWidth" ](true); $.effects.createWrapper(el).css({ overflow: "hidden" }); if(show){ el.css(ref, positiveMotion ? (isNaN(distance) ? "-" + distance:-distance):distance); } animation[ ref ]=(show ? (positiveMotion ? "+=":"-=") : (positiveMotion ? "-=":"+=")) + distance; el.animate(animation, { queue: false, duration: o.duration, easing: o.easing, complete: function(){ if(mode==="hide"){ el.hide(); } $.effects.restore(el, props); $.effects.removeWrapper(el); done(); }}); }; var effectTransfer=$.effects.effect.transfer=function(o, done){ var elem=$(this), target=$(o.to), targetFixed=target.css("position")==="fixed", body=$("body"), fixTop=targetFixed ? body.scrollTop():0, fixLeft=targetFixed ? body.scrollLeft():0, endPosition=target.offset(), animation={ top: endPosition.top - fixTop, left: endPosition.left - fixLeft, height: target.innerHeight(), width: target.innerWidth() }, startPosition=elem.offset(), transfer=$("
") .appendTo(document.body) .addClass(o.className) .css({ top: startPosition.top - fixTop, left: startPosition.left - fixLeft, height: elem.innerHeight(), width: elem.innerWidth(), position: targetFixed ? "fixed":"absolute" }) .animate(animation, o.duration, o.easing, function(){ transfer.remove(); done(); }); }; var progressbar=$.widget("ui.progressbar", { version: "1.11.4", options: { max: 100, value: 0, change: null, complete: null }, min: 0, _create: function(){ this.oldValue=this.options.value=this._constrainedValue(); this.element .addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all") .attr({ role: "progressbar", "aria-valuemin": this.min }); this.valueDiv=$("
") .appendTo(this.element); this._refreshValue(); }, _destroy: function(){ this.element .removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all") .removeAttr("role") .removeAttr("aria-valuemin") .removeAttr("aria-valuemax") .removeAttr("aria-valuenow"); this.valueDiv.remove(); }, value: function(newValue){ if(newValue===undefined){ return this.options.value; } this.options.value=this._constrainedValue(newValue); this._refreshValue(); }, _constrainedValue: function(newValue){ if(newValue===undefined){ newValue=this.options.value; } this.indeterminate=newValue===false; if(typeof newValue!=="number"){ newValue=0; } return this.indeterminate ? false : Math.min(this.options.max, Math.max(this.min, newValue)); }, _setOptions: function(options){ var value=options.value; delete options.value; this._super(options); this.options.value=this._constrainedValue(value); this._refreshValue(); }, _setOption: function(key, value){ if(key==="max"){ value=Math.max(this.min, value); } if(key==="disabled"){ this.element .toggleClass("ui-state-disabled", !!value) .attr("aria-disabled", value); } this._super(key, value); }, _percentage: function(){ return this.indeterminate ? 100:100 *(this.options.value - this.min) /(this.options.max - this.min); }, _refreshValue: function(){ var value=this.options.value, percentage=this._percentage(); this.valueDiv .toggle(this.indeterminate||value > this.min) .toggleClass("ui-corner-right", value===this.options.max) .width(percentage.toFixed(0) + "%"); this.element.toggleClass("ui-progressbar-indeterminate", this.indeterminate); if(this.indeterminate){ this.element.removeAttr("aria-valuenow"); if(!this.overlayDiv){ this.overlayDiv=$("
").appendTo(this.valueDiv); }}else{ this.element.attr({ "aria-valuemax": this.options.max, "aria-valuenow": value }); if(this.overlayDiv){ this.overlayDiv.remove(); this.overlayDiv=null; }} if(this.oldValue!==value){ this.oldValue=value; this._trigger("change"); } if(value===this.options.max){ this._trigger("complete"); }} }); var selectable=$.widget("ui.selectable", $.ui.mouse, { version: "1.11.4", options: { appendTo: "body", autoRefresh: true, distance: 0, filter: "*", tolerance: "touch", selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null }, _create: function(){ var selectees, that=this; this.element.addClass("ui-selectable"); this.dragged=false; this.refresh=function(){ selectees=$(that.options.filter, that.element[0]); selectees.addClass("ui-selectee"); selectees.each(function(){ var $this=$(this), pos=$this.offset(); $.data(this, "selectable-item", { element: this, $element: $this, left: pos.left, top: pos.top, right: pos.left + $this.outerWidth(), bottom: pos.top + $this.outerHeight(), startselected: false, selected: $this.hasClass("ui-selected"), selecting: $this.hasClass("ui-selecting"), unselecting: $this.hasClass("ui-unselecting") }); }); }; this.refresh(); this.selectees=selectees.addClass("ui-selectee"); this._mouseInit(); this.helper=$("
"); }, _destroy: function(){ this.selectees .removeClass("ui-selectee") .removeData("selectable-item"); this.element .removeClass("ui-selectable ui-selectable-disabled"); this._mouseDestroy(); }, _mouseStart: function(event){ var that=this, options=this.options; this.opos=[ event.pageX, event.pageY ]; if(this.options.disabled){ return; } this.selectees=$(options.filter, this.element[0]); this._trigger("start", event); $(options.appendTo).append(this.helper); this.helper.css({ "left": event.pageX, "top": event.pageY, "width": 0, "height": 0 }); if(options.autoRefresh){ this.refresh(); } this.selectees.filter(".ui-selected").each(function(){ var selectee=$.data(this, "selectable-item"); selectee.startselected=true; if(!event.metaKey&&!event.ctrlKey){ selectee.$element.removeClass("ui-selected"); selectee.selected=false; selectee.$element.addClass("ui-unselecting"); selectee.unselecting=true; that._trigger("unselecting", event, { unselecting: selectee.element }); }}); $(event.target).parents().addBack().each(function(){ var doSelect, selectee=$.data(this, "selectable-item"); if(selectee){ doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected"); selectee.$element .removeClass(doSelect ? "ui-unselecting":"ui-selected") .addClass(doSelect ? "ui-selecting":"ui-unselecting"); selectee.unselecting = !doSelect; selectee.selecting=doSelect; selectee.selected=doSelect; if(doSelect){ that._trigger("selecting", event, { selecting: selectee.element }); }else{ that._trigger("unselecting", event, { unselecting: selectee.element }); } return false; }}); }, _mouseDrag: function(event){ this.dragged=true; if(this.options.disabled){ return; } var tmp, that=this, options=this.options, x1=this.opos[0], y1=this.opos[1], x2=event.pageX, y2=event.pageY; if(x1 > x2){ tmp=x2; x2=x1; x1=tmp; } if(y1 > y2){ tmp=y2; y2=y1; y1=tmp; } this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 }); this.selectees.each(function(){ var selectee=$.data(this, "selectable-item"), hit=false; if(!selectee||selectee.element===that.element[0]){ return; } if(options.tolerance==="touch"){ hit=(!(selectee.left > x2||selectee.right < x1||selectee.top > y2||selectee.bottom < y1)); }else if(options.tolerance==="fit"){ hit=(selectee.left > x1&&selectee.right < x2&&selectee.top > y1&&selectee.bottom < y2); } if(hit){ if(selectee.selected){ selectee.$element.removeClass("ui-selected"); selectee.selected=false; } if(selectee.unselecting){ selectee.$element.removeClass("ui-unselecting"); selectee.unselecting=false; } if(!selectee.selecting){ selectee.$element.addClass("ui-selecting"); selectee.selecting=true; that._trigger("selecting", event, { selecting: selectee.element }); }}else{ if(selectee.selecting){ if((event.metaKey||event.ctrlKey)&&selectee.startselected){ selectee.$element.removeClass("ui-selecting"); selectee.selecting=false; selectee.$element.addClass("ui-selected"); selectee.selected=true; }else{ selectee.$element.removeClass("ui-selecting"); selectee.selecting=false; if(selectee.startselected){ selectee.$element.addClass("ui-unselecting"); selectee.unselecting=true; } that._trigger("unselecting", event, { unselecting: selectee.element }); }} if(selectee.selected){ if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){ selectee.$element.removeClass("ui-selected"); selectee.selected=false; selectee.$element.addClass("ui-unselecting"); selectee.unselecting=true; that._trigger("unselecting", event, { unselecting: selectee.element }); }} }}); return false; }, _mouseStop: function(event){ var that=this; this.dragged=false; $(".ui-unselecting", this.element[0]).each(function(){ var selectee=$.data(this, "selectable-item"); selectee.$element.removeClass("ui-unselecting"); selectee.unselecting=false; selectee.startselected=false; that._trigger("unselected", event, { unselected: selectee.element }); }); $(".ui-selecting", this.element[0]).each(function(){ var selectee=$.data(this, "selectable-item"); selectee.$element.removeClass("ui-selecting").addClass("ui-selected"); selectee.selecting=false; selectee.selected=true; selectee.startselected=true; that._trigger("selected", event, { selected: selectee.element }); }); this._trigger("stop", event); this.helper.remove(); return false; }}); var selectmenu=$.widget("ui.selectmenu", { version: "1.11.4", defaultElement: "", widgetEventPrefix: "spin", options: { culture: null, icons: { down: "ui-icon-triangle-1-s", up: "ui-icon-triangle-1-n" }, incremental: true, max: null, min: null, numberFormat: null, page: 10, step: 1, change: null, spin: null, start: null, stop: null }, _create: function(){ this._setOption("max", this.options.max); this._setOption("min", this.options.min); this._setOption("step", this.options.step); if(this.value()!==""){ this._value(this.element.val(), true); } this._draw(); this._on(this._events); this._refresh(); this._on(this.window, { beforeunload: function(){ this.element.removeAttr("autocomplete"); }}); }, _getCreateOptions: function(){ var options={}, element=this.element; $.each([ "min", "max", "step" ], function(i, option){ var value=element.attr(option); if(value!==undefined&&value.length){ options[ option ]=value; }}); return options; }, _events: { keydown: function(event){ if(this._start(event)&&this._keydown(event)){ event.preventDefault(); }}, keyup: "_stop", focus: function(){ this.previous=this.element.val(); }, blur: function(event){ if(this.cancelBlur){ delete this.cancelBlur; return; } this._stop(); this._refresh(); if(this.previous!==this.element.val()){ this._trigger("change", event); }}, mousewheel: function(event, delta){ if(!delta){ return; } if(!this.spinning&&!this._start(event)){ return false; } this._spin((delta > 0 ? 1:-1) * this.options.step, event); clearTimeout(this.mousewheelTimer); this.mousewheelTimer=this._delay(function(){ if(this.spinning){ this._stop(event); }}, 100); event.preventDefault(); }, "mousedown .ui-spinner-button": function(event){ var previous; previous=this.element[0]===this.document[0].activeElement ? this.previous:this.element.val(); function checkFocus(){ var isActive=this.element[0]===this.document[0].activeElement; if(!isActive){ this.element.focus(); this.previous=previous; this._delay(function(){ this.previous=previous; }); }} event.preventDefault(); checkFocus.call(this); this.cancelBlur=true; this._delay(function(){ delete this.cancelBlur; checkFocus.call(this); }); if(this._start(event)===false){ return; } this._repeat(null, $(event.currentTarget).hasClass("ui-spinner-up") ? 1:-1, event); }, "mouseup .ui-spinner-button": "_stop", "mouseenter .ui-spinner-button": function(event){ if(!$(event.currentTarget).hasClass("ui-state-active")){ return; } if(this._start(event)===false){ return false; } this._repeat(null, $(event.currentTarget).hasClass("ui-spinner-up") ? 1:-1, event); }, "mouseleave .ui-spinner-button": "_stop" }, _draw: function(){ var uiSpinner=this.uiSpinner=this.element .addClass("ui-spinner-input") .attr("autocomplete", "off") .wrap(this._uiSpinnerHtml()) .parent() .append(this._buttonHtml()); this.element.attr("role", "spinbutton"); this.buttons=uiSpinner.find(".ui-spinner-button") .attr("tabIndex", -1) .button() .removeClass("ui-corner-all"); if(this.buttons.height() > Math.ceil(uiSpinner.height() * 0.5) && uiSpinner.height() > 0){ uiSpinner.height(uiSpinner.height()); } if(this.options.disabled){ this.disable(); }}, _keydown: function(event){ var options=this.options, keyCode=$.ui.keyCode; switch(event.keyCode){ case keyCode.UP: this._repeat(null, 1, event); return true; case keyCode.DOWN: this._repeat(null, -1, event); return true; case keyCode.PAGE_UP: this._repeat(null, options.page, event); return true; case keyCode.PAGE_DOWN: this._repeat(null, -options.page, event); return true; } return false; }, _uiSpinnerHtml: function(){ return ""; }, _buttonHtml: function(){ return "" + "" + "" + "" + "" + "" + ""; }, _start: function(event){ if(!this.spinning&&this._trigger("start", event)===false){ return false; } if(!this.counter){ this.counter=1; } this.spinning=true; return true; }, _repeat: function(i, steps, event){ i=i||500; clearTimeout(this.timer); this.timer=this._delay(function(){ this._repeat(40, steps, event); }, i); this._spin(steps * this.options.step, event); }, _spin: function(step, event){ var value=this.value()||0; if(!this.counter){ this.counter=1; } value=this._adjustValue(value + step * this._increment(this.counter)); if(!this.spinning||this._trigger("spin", event, { value: value })!==false){ this._value(value); this.counter++; }}, _increment: function(i){ var incremental=this.options.incremental; if(incremental){ return $.isFunction(incremental) ? incremental(i) : Math.floor(i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1); } return 1; }, _precision: function(){ var precision=this._precisionOf(this.options.step); if(this.options.min!==null){ precision=Math.max(precision, this._precisionOf(this.options.min)); } return precision; }, _precisionOf: function(num){ var str=num.toString(), decimal=str.indexOf("."); return decimal===-1 ? 0:str.length - decimal - 1; }, _adjustValue: function(value){ var base, aboveMin, options=this.options; base=options.min!==null ? options.min:0; aboveMin=value - base; aboveMin=Math.round(aboveMin / options.step) * options.step; value=base + aboveMin; value=parseFloat(value.toFixed(this._precision())); if(options.max!==null&&value > options.max){ return options.max; } if(options.min!==null&&value < options.min){ return options.min; } return value; }, _stop: function(event){ if(!this.spinning){ return; } clearTimeout(this.timer); clearTimeout(this.mousewheelTimer); this.counter=0; this.spinning=false; this._trigger("stop", event); }, _setOption: function(key, value){ if(key==="culture"||key==="numberFormat"){ var prevValue=this._parse(this.element.val()); this.options[ key ]=value; this.element.val(this._format(prevValue)); return; } if(key==="max"||key==="min"||key==="step"){ if(typeof value==="string"){ value=this._parse(value); }} if(key==="icons"){ this.buttons.first().find(".ui-icon") .removeClass(this.options.icons.up) .addClass(value.up); this.buttons.last().find(".ui-icon") .removeClass(this.options.icons.down) .addClass(value.down); } this._super(key, value); if(key==="disabled"){ this.widget().toggleClass("ui-state-disabled", !!value); this.element.prop("disabled", !!value); this.buttons.button(value ? "disable":"enable"); }}, _setOptions: spinner_modifier(function(options){ this._super(options); }), _parse: function(val){ if(typeof val==="string"&&val!==""){ val=window.Globalize&&this.options.numberFormat ? Globalize.parseFloat(val, 10, this.options.culture):+val; } return val===""||isNaN(val) ? null:val; }, _format: function(value){ if(value===""){ return ""; } return window.Globalize&&this.options.numberFormat ? Globalize.format(value, this.options.numberFormat, this.options.culture) : value; }, _refresh: function(){ this.element.attr({ "aria-valuemin": this.options.min, "aria-valuemax": this.options.max, "aria-valuenow": this._parse(this.element.val()) }); }, isValid: function(){ var value=this.value(); if(value===null){ return false; } return value===this._adjustValue(value); }, _value: function(value, allowAny){ var parsed; if(value!==""){ parsed=this._parse(value); if(parsed!==null){ if(!allowAny){ parsed=this._adjustValue(parsed); } value=this._format(parsed); }} this.element.val(value); this._refresh(); }, _destroy: function(){ this.element .removeClass("ui-spinner-input") .prop("disabled", false) .removeAttr("autocomplete") .removeAttr("role") .removeAttr("aria-valuemin") .removeAttr("aria-valuemax") .removeAttr("aria-valuenow"); this.uiSpinner.replaceWith(this.element); }, stepUp: spinner_modifier(function(steps){ this._stepUp(steps); }), _stepUp: function(steps){ if(this._start()){ this._spin((steps||1) * this.options.step); this._stop(); }}, stepDown: spinner_modifier(function(steps){ this._stepDown(steps); }), _stepDown: function(steps){ if(this._start()){ this._spin((steps||1) * -this.options.step); this._stop(); }}, pageUp: spinner_modifier(function(pages){ this._stepUp((pages||1) * this.options.page); }), pageDown: spinner_modifier(function(pages){ this._stepDown((pages||1) * this.options.page); }), value: function(newVal){ if(!arguments.length){ return this._parse(this.element.val()); } spinner_modifier(this._value).call(this, newVal); }, widget: function(){ return this.uiSpinner; }}); var tabs=$.widget("ui.tabs", { version: "1.11.4", delay: 300, options: { active: null, collapsible: false, event: "click", heightStyle: "content", hide: null, show: null, activate: null, beforeActivate: null, beforeLoad: null, load: null }, _isLocal: (function(){ var rhash=/#.*$/; return function(anchor){ var anchorUrl, locationUrl; anchor=anchor.cloneNode(false); anchorUrl=anchor.href.replace(rhash, ""); locationUrl=location.href.replace(rhash, ""); try { anchorUrl=decodeURIComponent(anchorUrl); } catch(error){} try { locationUrl=decodeURIComponent(locationUrl); } catch(error){} return anchor.hash.length > 1&&anchorUrl===locationUrl; };})(), _create: function(){ var that=this, options=this.options; this.running=false; this.element .addClass("ui-tabs ui-widget ui-widget-content ui-corner-all") .toggleClass("ui-tabs-collapsible", options.collapsible); this._processTabs(); options.active=this._initialActive(); if($.isArray(options.disabled)){ options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"), function(li){ return that.tabs.index(li); }) )).sort(); } if(this.options.active!==false&&this.anchors.length){ this.active=this._findActive(options.active); }else{ this.active=$(); } this._refresh(); if(this.active.length){ this.load(options.active); }}, _initialActive: function(){ var active=this.options.active, collapsible=this.options.collapsible, locationHash=location.hash.substring(1); if(active===null){ if(locationHash){ this.tabs.each(function(i, tab){ if($(tab).attr("aria-controls")===locationHash){ active=i; return false; }}); } if(active===null){ active=this.tabs.index(this.tabs.filter(".ui-tabs-active")); } if(active===null||active===-1){ active=this.tabs.length ? 0:false; }} if(active!==false){ active=this.tabs.index(this.tabs.eq(active)); if(active===-1){ active=collapsible ? false:0; }} if(!collapsible&&active===false&&this.anchors.length){ active=0; } return active; }, _getCreateEventData: function(){ return { tab: this.active, panel: !this.active.length ? $():this._getPanelForTab(this.active) };}, _tabKeydown: function(event){ var focusedTab=$(this.document[0].activeElement).closest("li"), selectedIndex=this.tabs.index(focusedTab), goingForward=true; if(this._handlePageNav(event)){ return; } switch(event.keyCode){ case $.ui.keyCode.RIGHT: case $.ui.keyCode.DOWN: selectedIndex++; break; case $.ui.keyCode.UP: case $.ui.keyCode.LEFT: goingForward=false; selectedIndex--; break; case $.ui.keyCode.END: selectedIndex=this.anchors.length - 1; break; case $.ui.keyCode.HOME: selectedIndex=0; break; case $.ui.keyCode.SPACE: event.preventDefault(); clearTimeout(this.activating); this._activate(selectedIndex); return; case $.ui.keyCode.ENTER: event.preventDefault(); clearTimeout(this.activating); this._activate(selectedIndex===this.options.active ? false:selectedIndex); return; default: return; } event.preventDefault(); clearTimeout(this.activating); selectedIndex=this._focusNextTab(selectedIndex, goingForward); if(!event.ctrlKey&&!event.metaKey){ focusedTab.attr("aria-selected", "false"); this.tabs.eq(selectedIndex).attr("aria-selected", "true"); this.activating=this._delay(function(){ this.option("active", selectedIndex); }, this.delay); }}, _panelKeydown: function(event){ if(this._handlePageNav(event)){ return; } if(event.ctrlKey&&event.keyCode===$.ui.keyCode.UP){ event.preventDefault(); this.active.focus(); }}, _handlePageNav: function(event){ if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP){ this._activate(this._focusNextTab(this.options.active - 1, false)); return true; } if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN){ this._activate(this._focusNextTab(this.options.active + 1, true)); return true; }}, _findNextTab: function(index, goingForward){ var lastTabIndex=this.tabs.length - 1; function constrain(){ if(index > lastTabIndex){ index=0; } if(index < 0){ index=lastTabIndex; } return index; } while($.inArray(constrain(), this.options.disabled)!==-1){ index=goingForward ? index + 1:index - 1; } return index; }, _focusNextTab: function(index, goingForward){ index=this._findNextTab(index, goingForward); this.tabs.eq(index).focus(); return index; }, _setOption: function(key, value){ if(key==="active"){ this._activate(value); return; } if(key==="disabled"){ this._setupDisabled(value); return; } this._super(key, value); if(key==="collapsible"){ this.element.toggleClass("ui-tabs-collapsible", value); if(!value&&this.options.active===false){ this._activate(0); }} if(key==="event"){ this._setupEvents(value); } if(key==="heightStyle"){ this._setupHeightStyle(value); }}, _sanitizeSelector: function(hash){ return hash ? hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&"):""; }, refresh: function(){ var options=this.options, lis=this.tablist.children(":has(a[href])"); options.disabled=$.map(lis.filter(".ui-state-disabled"), function(tab){ return lis.index(tab); }); this._processTabs(); if(options.active===false||!this.anchors.length){ options.active=false; this.active=$(); }else if(this.active.length&&!$.contains(this.tablist[ 0 ], this.active[ 0 ])){ if(this.tabs.length===options.disabled.length){ options.active=false; this.active=$(); }else{ this._activate(this._findNextTab(Math.max(0, options.active - 1), false)); }}else{ options.active=this.tabs.index(this.active); } this._refresh(); }, _refresh: function(){ this._setupDisabled(this.options.disabled); this._setupEvents(this.options.event); this._setupHeightStyle(this.options.heightStyle); this.tabs.not(this.active).attr({ "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 }); this.panels.not(this._getPanelForTab(this.active)) .hide() .attr({ "aria-hidden": "true" }); if(!this.active.length){ this.tabs.eq(0).attr("tabIndex", 0); }else{ this.active .addClass("ui-tabs-active ui-state-active") .attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }); this._getPanelForTab(this.active) .show() .attr({ "aria-hidden": "false" }); }}, _processTabs: function(){ var that=this, prevTabs=this.tabs, prevAnchors=this.anchors, prevPanels=this.panels; this.tablist=this._getList() .addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all") .attr("role", "tablist") .delegate("> li", "mousedown" + this.eventNamespace, function(event){ if($(this).is(".ui-state-disabled")){ event.preventDefault(); }}) .delegate(".ui-tabs-anchor", "focus" + this.eventNamespace, function(){ if($(this).closest("li").is(".ui-state-disabled")){ this.blur(); }}); this.tabs=this.tablist.find("> li:has(a[href])") .addClass("ui-state-default ui-corner-top") .attr({ role: "tab", tabIndex: -1 }); this.anchors=this.tabs.map(function(){ return $("a", this)[ 0 ]; }) .addClass("ui-tabs-anchor") .attr({ role: "presentation", tabIndex: -1 }); this.panels=$(); this.anchors.each(function(i, anchor){ var selector, panel, panelId, anchorId=$(anchor).uniqueId().attr("id"), tab=$(anchor).closest("li"), originalAriaControls=tab.attr("aria-controls"); if(that._isLocal(anchor)){ selector=anchor.hash; panelId=selector.substring(1); panel=that.element.find(that._sanitizeSelector(selector)); }else{ panelId=tab.attr("aria-controls")||$({}).uniqueId()[ 0 ].id; selector="#" + panelId; panel=that.element.find(selector); if(!panel.length){ panel=that._createPanel(panelId); panel.insertAfter(that.panels[ i - 1 ]||that.tablist); } panel.attr("aria-live", "polite"); } if(panel.length){ that.panels=that.panels.add(panel); } if(originalAriaControls){ tab.data("ui-tabs-aria-controls", originalAriaControls); } tab.attr({ "aria-controls": panelId, "aria-labelledby": anchorId }); panel.attr("aria-labelledby", anchorId); }); this.panels .addClass("ui-tabs-panel ui-widget-content ui-corner-bottom") .attr("role", "tabpanel"); if(prevTabs){ this._off(prevTabs.not(this.tabs)); this._off(prevAnchors.not(this.anchors)); this._off(prevPanels.not(this.panels)); }}, _getList: function(){ return this.tablist||this.element.find("ol,ul").eq(0); }, _createPanel: function(id){ return $("
") .attr("id", id) .addClass("ui-tabs-panel ui-widget-content ui-corner-bottom") .data("ui-tabs-destroy", true); }, _setupDisabled: function(disabled){ if($.isArray(disabled)){ if(!disabled.length){ disabled=false; }else if(disabled.length===this.anchors.length){ disabled=true; }} for(var i=0, li;(li=this.tabs[ i ]); i++){ if(disabled===true||$.inArray(i, disabled)!==-1){ $(li) .addClass("ui-state-disabled") .attr("aria-disabled", "true"); }else{ $(li) .removeClass("ui-state-disabled") .removeAttr("aria-disabled"); }} this.options.disabled=disabled; }, _setupEvents: function(event){ var events={}; if(event){ $.each(event.split(" "), function(index, eventName){ events[ eventName ]="_eventHandler"; }); } this._off(this.anchors.add(this.tabs).add(this.panels)); this._on(true, this.anchors, { click: function(event){ event.preventDefault(); }}); this._on(this.anchors, events); this._on(this.tabs, { keydown: "_tabKeydown" }); this._on(this.panels, { keydown: "_panelKeydown" }); this._focusable(this.tabs); this._hoverable(this.tabs); }, _setupHeightStyle: function(heightStyle){ var maxHeight, parent=this.element.parent(); if(heightStyle==="fill"){ maxHeight=parent.height(); maxHeight -=this.element.outerHeight() - this.element.height(); this.element.siblings(":visible").each(function(){ var elem=$(this), position=elem.css("position"); if(position==="absolute"||position==="fixed"){ return; } maxHeight -=elem.outerHeight(true); }); this.element.children().not(this.panels).each(function(){ maxHeight -=$(this).outerHeight(true); }); this.panels.each(function(){ $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height())); }) .css("overflow", "auto"); }else if(heightStyle==="auto"){ maxHeight=0; this.panels.each(function(){ maxHeight=Math.max(maxHeight, $(this).height("").height()); }).height(maxHeight); }}, _eventHandler: function(event){ var options=this.options, active=this.active, anchor=$(event.currentTarget), tab=anchor.closest("li"), clickedIsActive=tab[ 0 ]===active[ 0 ], collapsing=clickedIsActive&&options.collapsible, toShow=collapsing ? $():this._getPanelForTab(tab), toHide = !active.length ? $():this._getPanelForTab(active), eventData={ oldTab: active, oldPanel: toHide, newTab: collapsing ? $():tab, newPanel: toShow }; event.preventDefault(); if(tab.hasClass("ui-state-disabled") || tab.hasClass("ui-tabs-loading") || this.running || (clickedIsActive&&!options.collapsible) || (this._trigger("beforeActivate", event, eventData)===false)){ return; } options.active=collapsing ? false:this.tabs.index(tab); this.active=clickedIsActive ? $():tab; if(this.xhr){ this.xhr.abort(); } if(!toHide.length&&!toShow.length){ $.error("jQuery UI Tabs: Mismatching fragment identifier."); } if(toShow.length){ this.load(this.tabs.index(tab), event); } this._toggle(event, eventData); }, _toggle: function(event, eventData){ var that=this, toShow=eventData.newPanel, toHide=eventData.oldPanel; this.running=true; function complete(){ that.running=false; that._trigger("activate", event, eventData); } function show(){ eventData.newTab.closest("li").addClass("ui-tabs-active ui-state-active"); if(toShow.length&&that.options.show){ that._show(toShow, that.options.show, complete); }else{ toShow.show(); complete(); }} if(toHide.length&&this.options.hide){ this._hide(toHide, this.options.hide, function(){ eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"); show(); }); }else{ eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"); toHide.hide(); show(); } toHide.attr("aria-hidden", "true"); eventData.oldTab.attr({ "aria-selected": "false", "aria-expanded": "false" }); if(toShow.length&&toHide.length){ eventData.oldTab.attr("tabIndex", -1); }else if(toShow.length){ this.tabs.filter(function(){ return $(this).attr("tabIndex")===0; }) .attr("tabIndex", -1); } toShow.attr("aria-hidden", "false"); eventData.newTab.attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }); }, _activate: function(index){ var anchor, active=this._findActive(index); if(active[ 0 ]===this.active[ 0 ]){ return; } if(!active.length){ active=this.active; } anchor=active.find(".ui-tabs-anchor")[ 0 ]; this._eventHandler({ target: anchor, currentTarget: anchor, preventDefault: $.noop }); }, _findActive: function(index){ return index===false ? $():this.tabs.eq(index); }, _getIndex: function(index){ if(typeof index==="string"){ index=this.anchors.index(this.anchors.filter("[href$='" + index + "']")); } return index; }, _destroy: function(){ if(this.xhr){ this.xhr.abort(); } this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"); this.tablist .removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all") .removeAttr("role"); this.anchors .removeClass("ui-tabs-anchor") .removeAttr("role") .removeAttr("tabIndex") .removeUniqueId(); this.tablist.unbind(this.eventNamespace); this.tabs.add(this.panels).each(function(){ if($.data(this, "ui-tabs-destroy")){ $(this).remove(); }else{ $(this) .removeClass("ui-state-default ui-state-active ui-state-disabled " + "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel") .removeAttr("tabIndex") .removeAttr("aria-live") .removeAttr("aria-busy") .removeAttr("aria-selected") .removeAttr("aria-labelledby") .removeAttr("aria-hidden") .removeAttr("aria-expanded") .removeAttr("role"); }}); this.tabs.each(function(){ var li=$(this), prev=li.data("ui-tabs-aria-controls"); if(prev){ li .attr("aria-controls", prev) .removeData("ui-tabs-aria-controls"); }else{ li.removeAttr("aria-controls"); }}); this.panels.show(); if(this.options.heightStyle!=="content"){ this.panels.css("height", ""); }}, enable: function(index){ var disabled=this.options.disabled; if(disabled===false){ return; } if(index===undefined){ disabled=false; }else{ index=this._getIndex(index); if($.isArray(disabled)){ disabled=$.map(disabled, function(num){ return num!==index ? num:null; }); }else{ disabled=$.map(this.tabs, function(li, num){ return num!==index ? num:null; }); }} this._setupDisabled(disabled); }, disable: function(index){ var disabled=this.options.disabled; if(disabled===true){ return; } if(index===undefined){ disabled=true; }else{ index=this._getIndex(index); if($.inArray(index, disabled)!==-1){ return; } if($.isArray(disabled)){ disabled=$.merge([ index ], disabled).sort(); }else{ disabled=[ index ]; }} this._setupDisabled(disabled); }, load: function(index, event){ index=this._getIndex(index); var that=this, tab=this.tabs.eq(index), anchor=tab.find(".ui-tabs-anchor"), panel=this._getPanelForTab(tab), eventData={ tab: tab, panel: panel }, complete=function(jqXHR, status){ if(status==="abort"){ that.panels.stop(false, true); } tab.removeClass("ui-tabs-loading"); panel.removeAttr("aria-busy"); if(jqXHR===that.xhr){ delete that.xhr; }}; if(this._isLocal(anchor[ 0 ])){ return; } this.xhr=$.ajax(this._ajaxSettings(anchor, event, eventData)); if(this.xhr&&this.xhr.statusText!=="canceled"){ tab.addClass("ui-tabs-loading"); panel.attr("aria-busy", "true"); this.xhr .done(function(response, status, jqXHR){ setTimeout(function(){ panel.html(response); that._trigger("load", event, eventData); complete(jqXHR, status); }, 1); }) .fail(function(jqXHR, status){ setTimeout(function(){ complete(jqXHR, status); }, 1); }); }}, _ajaxSettings: function(anchor, event, eventData){ var that=this; return { url: anchor.attr("href"), beforeSend: function(jqXHR, settings){ return that._trigger("beforeLoad", event, $.extend({ jqXHR: jqXHR, ajaxSettings: settings }, eventData)); }};}, _getPanelForTab: function(tab){ var id=$(tab).attr("aria-controls"); return this.element.find(this._sanitizeSelector("#" + id)); }}); var tooltip=$.widget("ui.tooltip", { version: "1.11.4", options: { content: function(){ var title=$(this).attr("title")||""; return $("").text(title).html(); }, hide: true, items: "[title]:not([disabled])", position: { my: "left top+15", at: "left bottom", collision: "flipfit flip" }, show: true, tooltipClass: null, track: false, close: null, open: null }, _addDescribedBy: function(elem, id){ var describedby=(elem.attr("aria-describedby")||"").split(/\s+/); describedby.push(id); elem .data("ui-tooltip-id", id) .attr("aria-describedby", $.trim(describedby.join(" "))); }, _removeDescribedBy: function(elem){ var id=elem.data("ui-tooltip-id"), describedby=(elem.attr("aria-describedby")||"").split(/\s+/), index=$.inArray(id, describedby); if(index!==-1){ describedby.splice(index, 1); } elem.removeData("ui-tooltip-id"); describedby=$.trim(describedby.join(" ")); if(describedby){ elem.attr("aria-describedby", describedby); }else{ elem.removeAttr("aria-describedby"); }}, _create: function(){ this._on({ mouseover: "open", focusin: "open" }); this.tooltips={}; this.parents={}; if(this.options.disabled){ this._disable(); } this.liveRegion=$("
") .attr({ role: "log", "aria-live": "assertive", "aria-relevant": "additions" }) .addClass("ui-helper-hidden-accessible") .appendTo(this.document[ 0 ].body); }, _setOption: function(key, value){ var that=this; if(key==="disabled"){ this[ value ? "_disable":"_enable" ](); this.options[ key ]=value; return; } this._super(key, value); if(key==="content"){ $.each(this.tooltips, function(id, tooltipData){ that._updateContent(tooltipData.element); }); }}, _disable: function(){ var that=this; $.each(this.tooltips, function(id, tooltipData){ var event=$.Event("blur"); event.target=event.currentTarget=tooltipData.element[ 0 ]; that.close(event, true); }); this.element.find(this.options.items).addBack().each(function(){ var element=$(this); if(element.is("[title]")){ element .data("ui-tooltip-title", element.attr("title")) .removeAttr("title"); }}); }, _enable: function(){ this.element.find(this.options.items).addBack().each(function(){ var element=$(this); if(element.data("ui-tooltip-title")){ element.attr("title", element.data("ui-tooltip-title")); }}); }, open: function(event){ var that=this, target=$(event ? event.target:this.element) .closest(this.options.items); if(!target.length||target.data("ui-tooltip-id")){ return; } if(target.attr("title")){ target.data("ui-tooltip-title", target.attr("title")); } target.data("ui-tooltip-open", true); if(event&&event.type==="mouseover"){ target.parents().each(function(){ var parent=$(this), blurEvent; if(parent.data("ui-tooltip-open")){ blurEvent=$.Event("blur"); blurEvent.target=blurEvent.currentTarget=this; that.close(blurEvent, true); } if(parent.attr("title")){ parent.uniqueId(); that.parents[ this.id ]={ element: this, title: parent.attr("title") }; parent.attr("title", ""); }}); } this._registerCloseHandlers(event, target); this._updateContent(target, event); }, _updateContent: function(target, event){ var content, contentOption=this.options.content, that=this, eventType=event ? event.type:null; if(typeof contentOption==="string"){ return this._open(event, target, contentOption); } content=contentOption.call(target[0], function(response){ that._delay(function(){ if(!target.data("ui-tooltip-open")){ return; } if(event){ event.type=eventType; } this._open(event, target, response); }); }); if(content){ this._open(event, target, content); }}, _open: function(event, target, content){ var tooltipData, tooltip, delayedShow, a11yContent, positionOption=$.extend({}, this.options.position); if(!content){ return; } tooltipData=this._find(target); if(tooltipData){ tooltipData.tooltip.find(".ui-tooltip-content").html(content); return; } if(target.is("[title]")){ if(event&&event.type==="mouseover"){ target.attr("title", ""); }else{ target.removeAttr("title"); }} tooltipData=this._tooltip(target); tooltip=tooltipData.tooltip; this._addDescribedBy(target, tooltip.attr("id")); tooltip.find(".ui-tooltip-content").html(content); this.liveRegion.children().hide(); if(content.clone){ a11yContent=content.clone(); a11yContent.removeAttr("id").find("[id]").removeAttr("id"); }else{ a11yContent=content; } $("
").html(a11yContent).appendTo(this.liveRegion); function position(event){ positionOption.of=event; if(tooltip.is(":hidden")){ return; } tooltip.position(positionOption); } if(this.options.track&&event&&/^mouse/.test(event.type)){ this._on(this.document, { mousemove: position }); position(event); }else{ tooltip.position($.extend({ of: target }, this.options.position)); } tooltip.hide(); this._show(tooltip, this.options.show); if(this.options.show&&this.options.show.delay){ delayedShow=this.delayedShow=setInterval(function(){ if(tooltip.is(":visible")){ position(positionOption.of); clearInterval(delayedShow); }}, $.fx.interval); } this._trigger("open", event, { tooltip: tooltip }); }, _registerCloseHandlers: function(event, target){ var events={ keyup: function(event){ if(event.keyCode===$.ui.keyCode.ESCAPE){ var fakeEvent=$.Event(event); fakeEvent.currentTarget=target[0]; this.close(fakeEvent, true); }} }; if(target[ 0 ]!==this.element[ 0 ]){ events.remove=function(){ this._removeTooltip(this._find(target).tooltip); };} if(!event||event.type==="mouseover"){ events.mouseleave="close"; } if(!event||event.type==="focusin"){ events.focusout="close"; } this._on(true, target, events); }, close: function(event){ var tooltip, that=this, target=$(event ? event.currentTarget:this.element), tooltipData=this._find(target); if(!tooltipData){ target.removeData("ui-tooltip-open"); return; } tooltip=tooltipData.tooltip; if(tooltipData.closing){ return; } clearInterval(this.delayedShow); if(target.data("ui-tooltip-title")&&!target.attr("title")){ target.attr("title", target.data("ui-tooltip-title")); } this._removeDescribedBy(target); tooltipData.hiding=true; tooltip.stop(true); this._hide(tooltip, this.options.hide, function(){ that._removeTooltip($(this)); }); target.removeData("ui-tooltip-open"); this._off(target, "mouseleave focusout keyup"); if(target[ 0 ]!==this.element[ 0 ]){ this._off(target, "remove"); } this._off(this.document, "mousemove"); if(event&&event.type==="mouseleave"){ $.each(this.parents, function(id, parent){ $(parent.element).attr("title", parent.title); delete that.parents[ id ]; }); } tooltipData.closing=true; this._trigger("close", event, { tooltip: tooltip }); if(!tooltipData.hiding){ tooltipData.closing=false; }}, _tooltip: function(element){ var tooltip=$("
") .attr("role", "tooltip") .addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass||"")), id=tooltip.uniqueId().attr("id"); $("
") .addClass("ui-tooltip-content") .appendTo(tooltip); tooltip.appendTo(this.document[0].body); return this.tooltips[ id ]={ element: element, tooltip: tooltip };}, _find: function(target){ var id=target.data("ui-tooltip-id"); return id ? this.tooltips[ id ]:null; }, _removeTooltip: function(tooltip){ tooltip.remove(); delete this.tooltips[ tooltip.attr("id") ]; }, _destroy: function(){ var that=this; $.each(this.tooltips, function(id, tooltipData){ var event=$.Event("blur"), element=tooltipData.element; event.target=event.currentTarget=element[ 0 ]; that.close(event, true); $("#" + id).remove(); if(element.data("ui-tooltip-title")){ if(!element.attr("title")){ element.attr("title", element.data("ui-tooltip-title")); } element.removeData("ui-tooltip-title"); }}); this.liveRegion.remove(); }}); })); (function (e){ function t(){ var e=location.href; hashtag=e.indexOf("#prettyPhoto")!==-1 ? decodeURI(e.substring(e.indexOf("#prettyPhoto") + 1, e.length)):false; return hashtag } function n(){ if(typeof theRel=="undefined")return; location.hash=theRel + "/" + rel_index + "/" } function r(){ if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto" } function i(e, t){ e=e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var n="[\\?&]" + e + "=([^&#]*)"; var r=new RegExp(n); var i=r.exec(t); return i==null ? "":i[1] } e.prettyPhoto={version: "3.1.5"}; e.fn.prettyPhoto=function (s){ function g(){ e(".pp_loaderIcon").hide(); projectedTop=scroll_pos["scrollTop"] + (d / 2 - a["containerHeight"] / 2); if(projectedTop < 0)projectedTop=0; $ppt.fadeTo(settings.animation_speed, 1); $pp_pic_holder.find(".pp_content").animate({height: a["contentHeight"], width: a["contentWidth"]}, settings.animation_speed); $pp_pic_holder.animate({top: projectedTop, left: v / 2 - a["containerWidth"] / 2 < 0 ? 0:v / 2 - a["containerWidth"] / 2, width: a["containerWidth"]}, settings.animation_speed, function (){ $pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]); $pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed); if(isSet&&S(pp_images[set_position])=="image"){ $pp_pic_holder.find(".pp_hoverContainer").show() }else{ $pp_pic_holder.find(".pp_hoverContainer").hide() } if(settings.allow_expand){ if(a["resized"]){ e("a.pp_expand,a.pp_contract").show() }else{ e("a.pp_expand").hide() }} if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow(); settings.changepicturecallback(); f=true }); C(); s.ajaxcallback() } function y(t){ $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility", "hidden"); $pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed, function (){ e(".pp_loaderIcon").show(); t() }) } function b(t){ t > 1 ? e(".pp_nav").show():e(".pp_nav").hide() } function w(e, t){ resized=false; E(e, t); imageWidth=e, imageHeight=t; if((p > v||h > d)&&doresize&&settings.allow_resize&&!u){ resized=true, fitting=false; while (!fitting){ if(p > v){ imageWidth=v - 200; imageHeight=t / e * imageWidth }else if(h > d){ imageHeight=d - 200; imageWidth=e / t * imageHeight }else{ fitting=true } h=imageHeight, p=imageWidth } if(p > v||h > d){ w(p, h) } E(imageWidth, imageHeight) } return{width: Math.floor(imageWidth), height: Math.floor(imageHeight), containerHeight: Math.floor(h), containerWidth: Math.floor(p) + settings.horizontal_padding * 2, contentHeight: Math.floor(l), contentWidth: Math.floor(c), resized: resized}} function E(t, n){ t=parseFloat(t); n=parseFloat(n); $pp_details=$pp_pic_holder.find(".pp_details"); $pp_details.width(t); detailsHeight=parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom")); $pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position: "absolute", top: -1e4}); detailsHeight +=$pp_details.height(); detailsHeight=detailsHeight <=34 ? 36:detailsHeight; $pp_details.remove(); $pp_title=$pp_pic_holder.find(".ppt"); $pp_title.width(t); titleHeight=parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom")); $pp_title=$pp_title.clone().appendTo(e("body")).css({position: "absolute", top: -1e4}); titleHeight +=$pp_title.height(); $pp_title.remove(); l=n + detailsHeight; c=t; h=l + titleHeight + $pp_pic_holder.find(".pp_top").height() + $pp_pic_holder.find(".pp_bottom").height(); p=t } function S(e){ if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){ return"youtube" }else if(e.match(/vimeo\.com/i)){ return"vimeo" }else if(e.match(/\b.mov\b/i)){ return"quicktime" }else if(e.match(/\b.swf\b/i)){ return"flash" }else if(e.match(/\biframe=true\b/i)){ return"iframe" }else if(e.match(/\bajax=true\b/i)){ return"ajax" }else if(e.match(/\bcustom=true\b/i)){ return"custom" }else if(e.substr(0, 1)=="#"){ return"inline" }else{ return"image" }} function x(){ if(doresize&&typeof $pp_pic_holder!="undefined"){ scroll_pos=T(); contentHeight=$pp_pic_holder.height(), contentwidth=$pp_pic_holder.width(); projectedTop=d / 2 + scroll_pos["scrollTop"] - contentHeight / 2; if(projectedTop < 0)projectedTop=0; if(contentHeight > d)return; $pp_pic_holder.css({top: projectedTop, left: v / 2 + scroll_pos["scrollLeft"] - contentwidth / 2}) }} function T(){ if(self.pageYOffset){ return{scrollTop: self.pageYOffset, scrollLeft: self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){ return{scrollTop: document.documentElement.scrollTop, scrollLeft: document.documentElement.scrollLeft}}else if(document.body){ return{scrollTop: document.body.scrollTop, scrollLeft: document.body.scrollLeft}} } function N(){ d=e(window).height(), v=e(window).width(); if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v) } function C(){ if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){ itemWidth=52 + 5; navWidth=settings.theme=="facebook"||settings.theme=="pp_default" ? 50:30; itemsPerPage=Math.floor((a["containerWidth"] - 100 - navWidth) / itemWidth); itemsPerPage=itemsPerPage < pp_images.length ? itemsPerPage:pp_images.length; totalPage=Math.ceil(pp_images.length / itemsPerPage) - 1; if(totalPage==0){ navWidth=0; $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide() }else{ $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show() } galleryWidth=itemsPerPage * itemWidth; fullGalleryWidth=pp_images.length * itemWidth; $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2)).find("div:first").width(galleryWidth + 5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected"); goToPage=Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage):totalPage; e.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(":eq(" + set_position + ")").addClass("selected") }else{ $pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave") }} function k(t){ if(settings.social_tools)facebook_like_link=settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)); settings.markup=settings.markup.replace("{pp_social}", ""); e("body").append(settings.markup); $pp_pic_holder=e(".pp_pic_holder"), $ppt=e(".ppt"), $pp_overlay=e("div.pp_overlay"); if(isSet&&settings.overlay_gallery){ currentGalleryPage=0; toInject=""; for (var n=0; n < pp_images.length; n++){ if(!pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi)){ classname="default"; img_src="" }else{ classname=""; img_src=pp_images[n] } toInject +="
  • " } toInject=settings.gallery_markup.replace(/{gallery}/g, toInject); $pp_pic_holder.find("#pp_full_res").after(toInject); $pp_gallery=e(".pp_pic_holder .pp_gallery"), $pp_gallery_li=$pp_gallery.find("li"); $pp_gallery.find(".pp_arrow_next").click(function (){ e.prettyPhoto.changeGalleryPage("next"); e.prettyPhoto.stopSlideshow(); return false }); $pp_gallery.find(".pp_arrow_previous").click(function (){ e.prettyPhoto.changeGalleryPage("previous"); e.prettyPhoto.stopSlideshow(); return false }); $pp_pic_holder.find(".pp_content").hover(function (){ $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn() }, function (){ $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut() }); itemWidth=52 + 5; $pp_gallery_li.each(function (t){ e(this).find("a").click(function (){ e.prettyPhoto.changePage(t); e.prettyPhoto.stopSlideshow(); return false }) }) } if(settings.slideshow){ $pp_pic_holder.find(".pp_nav").prepend('Play'); $pp_pic_holder.find(".pp_nav .pp_play").click(function (){ e.prettyPhoto.startSlideshow(); return false }) } $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme); $pp_overlay.css({opacity: 0, height: e(document).height(), width: e(window).width()}).bind("click", function (){ if(!settings.modal)e.prettyPhoto.close() }); e("a.pp_close").bind("click", function (){ e.prettyPhoto.close(); return false }); if(settings.allow_expand){ e("a.pp_expand").bind("click", function (t){ if(e(this).hasClass("pp_expand")){ e(this).removeClass("pp_expand").addClass("pp_contract"); doresize=false }else{ e(this).removeClass("pp_contract").addClass("pp_expand"); doresize=true } y(function (){ e.prettyPhoto.open() }); return false }) } $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click", function (){ e.prettyPhoto.changePage("previous"); e.prettyPhoto.stopSlideshow(); return false }); $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click", function (){ e.prettyPhoto.changePage("next"); e.prettyPhoto.stopSlideshow(); return false }); x() } s=jQuery.extend({hook: "rel", animation_speed: "fast", ajaxcallback: function (){ }, slideshow: 5e3, autoplay_slideshow: false, opacity: .8, show_title: true, allow_resize: true, allow_expand: true, default_width: 500, default_height: 344, counter_separator_label: "/", theme: "pp_default", horizontal_padding: 20, hideflash: false, wmode: "opaque", autoplay: true, modal: false, deeplinking: true, overlay_gallery: true, overlay_gallery_max: 30, keyboard_shortcuts: true, changepicturecallback: function (){ }, callback: function (){ }, ie6_fallback: true, markup: '
     
    ', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
    {content}
    ', custom_markup: "", social_tools: ''}, s); var o=this, u=false, a, f, l, c, h, p, d=e(window).height(), v=e(window).width(), m; doresize=true, scroll_pos=T(); e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto", function (){ x(); N() }); if(s.keyboard_shortcuts){ e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto", function (t){ if(typeof $pp_pic_holder!="undefined"){ if($pp_pic_holder.is(":visible")){ switch (t.keyCode){ case 37: e.prettyPhoto.changePage("previous"); t.preventDefault(); break; case 39: e.prettyPhoto.changePage("next"); t.preventDefault(); break; case 27: if(!settings.modal)e.prettyPhoto.close(); t.preventDefault(); break }} }}) } e.prettyPhoto.initialize=function (){ settings=s; if(settings.theme=="pp_default")settings.horizontal_padding=16; theRel=e(this).attr(settings.hook); galleryRegExp=/\[(?:.*)\]/; isSet=galleryRegExp.exec(theRel) ? true:false; pp_images=isSet ? jQuery.map(o, function (t, n){ if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href") }):e.makeArray(e(this).attr("href")); pp_titles=isSet ? jQuery.map(o, function (t, n){ if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt") ? e(t).find("img").attr("alt"):"" }):e.makeArray(e(this).find("img").attr("alt")); pp_descriptions=isSet ? jQuery.map(o, function (t, n){ if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title") ? e(t).attr("title"):"" }):e.makeArray(e(this).attr("title")); if(pp_images.length > settings.overlay_gallery_max)settings.overlay_gallery=false; set_position=jQuery.inArray(e(this).attr("href"), pp_images); rel_index=isSet ? set_position:e("a[" + settings.hook + "^='" + theRel + "']").index(e(this)); k(this); if(settings.allow_resize)e(window).bind("scroll.prettyphoto", function (){ x() }); e.prettyPhoto.open(); return false }; e.prettyPhoto.open=function (t){ if(typeof settings=="undefined"){ settings=s; pp_images=e.makeArray(arguments[0]); pp_titles=arguments[1] ? e.makeArray(arguments[1]):e.makeArray(""); pp_descriptions=arguments[2] ? e.makeArray(arguments[2]):e.makeArray(""); isSet=pp_images.length > 1 ? true:false; set_position=arguments[3] ? arguments[3]:0; k(t.target) } if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "hidden"); b(e(pp_images).size()); e(".pp_loaderIcon").show(); if(settings.deeplinking)n(); if(settings.social_tools){ facebook_like_link=settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)); $pp_pic_holder.find(".pp_social").html(facebook_like_link) } if($ppt.is(":hidden"))$ppt.css("opacity", 0).show(); $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity); $pp_pic_holder.find(".currentTextHolder").text(set_position + 1 + settings.counter_separator_label + e(pp_images).size()); if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){ $pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])) }else{ $pp_pic_holder.find(".pp_description").hide() } movie_width=parseFloat(i("width", pp_images[set_position])) ? i("width", pp_images[set_position]):settings.default_width.toString(); movie_height=parseFloat(i("height", pp_images[set_position])) ? i("height", pp_images[set_position]):settings.default_height.toString(); u=false; if(movie_height.indexOf("%")!=-1){ movie_height=parseFloat(e(window).height() * parseFloat(movie_height) / 100 - 150); u=true } if(movie_width.indexOf("%")!=-1){ movie_width=parseFloat(e(window).width() * parseFloat(movie_width) / 100 - 150); u=true } $pp_pic_holder.fadeIn(function (){ settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined" ? $ppt.html(unescape(pp_titles[set_position])):$ppt.html(" "); imgPreloader=""; skipInjection=false; switch (S(pp_images[set_position])){ case"image": imgPreloader=new Image; nextImage=new Image; if(isSet&&set_position < e(pp_images).size() - 1)nextImage.src=pp_images[set_position + 1]; prevImage=new Image; if(isSet&&pp_images[set_position - 1])prevImage.src=pp_images[set_position - 1]; $pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g, pp_images[set_position]); imgPreloader.onload=function (){ a=w(imgPreloader.width, imgPreloader.height); g() }; imgPreloader.onerror=function (){ alert("Image cannot be loaded. Make sure the path is correct and image exist."); e.prettyPhoto.close() }; imgPreloader.src=pp_images[set_position]; break; case"youtube": a=w(movie_width, movie_height); movie_id=i("v", pp_images[set_position]); if(movie_id==""){ movie_id=pp_images[set_position].split("youtu.be/"); movie_id=movie_id[1]; if(movie_id.indexOf("?") > 0)movie_id=movie_id.substr(0, movie_id.indexOf("?")); if(movie_id.indexOf("&") > 0)movie_id=movie_id.substr(0, movie_id.indexOf("&")) } movie="http://www.youtube.com/embed/" + movie_id; i("rel", pp_images[set_position]) ? movie +="?rel=" + i("rel", pp_images[set_position]):movie +="?rel=1"; if(settings.autoplay)movie +="&autoplay=1"; toInject=settings.iframe_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie); break; case"vimeo": a=w(movie_width, movie_height); movie_id=pp_images[set_position]; var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/; var n=movie_id.match(t); movie="http://player.vimeo.com/video/" + n[3] + "?title=0&byline=0&portrait=0"; if(settings.autoplay)movie +="&autoplay=1;"; vimeo_width=a["width"] + "/embed/?moog_width=" + a["width"]; toInject=settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, a["height"]).replace(/{path}/g, movie); break; case"quicktime": a=w(movie_width, movie_height); a["height"] +=15; a["contentHeight"] +=15; a["containerHeight"] +=15; toInject=settings.quicktime_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay); break; case"flash": a=w(movie_width, movie_height); flash_vars=pp_images[set_position]; flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length); filename=pp_images[set_position]; filename=filename.substring(0, filename.indexOf("?")); toInject=settings.flash_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + "?" + flash_vars); break; case"iframe": a=w(movie_width, movie_height); frame_url=pp_images[set_position]; frame_url=frame_url.substr(0, frame_url.indexOf("iframe") - 1); toInject=settings.iframe_markup.replace(/{width}/g, a["width"]).replace(/{height}/g, a["height"]).replace(/{path}/g, frame_url); break; case"ajax": doresize=false; a=w(movie_width, movie_height); doresize=true; skipInjection=true; e.get(pp_images[set_position], function (e){ toInject=settings.inline_markup.replace(/{content}/g, e); $pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject; g() }); break; case"custom": a=w(movie_width, movie_height); toInject=settings.custom_markup; break; case"inline": myClone=e(pp_images[set_position]).clone().append('
    ').css({width: settings.default_width}).wrapInner('
    ').appendTo(e("body")).show(); doresize=false; a=w(e(myClone).width(), e(myClone).height()); doresize=true; e(myClone).remove(); toInject=settings.inline_markup.replace(/{content}/g, e(pp_images[set_position]).html()); break } if(!imgPreloader&&!skipInjection){ $pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject; g() }}); return false }; e.prettyPhoto.changePage=function (t){ currentGalleryPage=0; if(t=="previous"){ set_position--; if(set_position < 0)set_position=e(pp_images).size() - 1 }else if(t=="next"){ set_position++; if(set_position > e(pp_images).size() - 1)set_position=0 }else{ set_position=t } rel_index=set_position; if(!doresize)doresize=true; if(settings.allow_expand){ e(".pp_contract").removeClass("pp_contract").addClass("pp_expand") } y(function (){ e.prettyPhoto.open() }) }; e.prettyPhoto.changeGalleryPage=function (e){ if(e=="next"){ currentGalleryPage++; if(currentGalleryPage > totalPage)currentGalleryPage=0 }else if(e=="previous"){ currentGalleryPage--; if(currentGalleryPage < 0)currentGalleryPage=totalPage }else{ currentGalleryPage=e } slide_speed=e=="next"||e=="previous" ? settings.animation_speed:0; slide_to=currentGalleryPage * itemsPerPage * itemWidth; $pp_gallery.find("ul").animate({left: -slide_to}, slide_speed) }; e.prettyPhoto.startSlideshow=function (){ if(typeof m=="undefined"){ $pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function (){ e.prettyPhoto.stopSlideshow(); return false }); m=setInterval(e.prettyPhoto.startSlideshow, settings.slideshow) }else{ e.prettyPhoto.changePage("next") }}; e.prettyPhoto.stopSlideshow=function (){ $pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function (){ e.prettyPhoto.startSlideshow(); return false }); clearInterval(m); m=undefined }; e.prettyPhoto.close=function (){ if($pp_overlay.is(":animated"))return; e.prettyPhoto.stopSlideshow(); $pp_pic_holder.stop().find("object,embed").css("visibility", "hidden"); e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed, function (){ e(this).remove() }); $pp_overlay.fadeOut(settings.animation_speed, function (){ if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "visible"); e(this).remove(); e(window).unbind("scroll.prettyphoto"); r(); settings.callback(); doresize=true; f=false; delete settings }) }; if(!pp_alreadyInitialized&&t()){ pp_alreadyInitialized=true; hashIndex=t(); hashRel=hashIndex; hashIndex=hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1); hashRel=hashRel.substring(0, hashRel.indexOf("/")); setTimeout(function (){ e("a[" + s.hook + "^='" + hashRel + "']:eq(" + hashIndex + ")").trigger("click") }, 50) } return this.unbind("click.prettyphoto").bind("click.prettyphoto", e.prettyPhoto.initialize) };})(jQuery); var pp_alreadyInitialized=false;